-
Notifications
You must be signed in to change notification settings - Fork 746
137 lines (124 loc) Β· 4.57 KB
/
ios-e2e.yml
File metadata and controls
137 lines (124 loc) Β· 4.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: iOS E2E
on:
push:
branches: [develop]
pull_request:
types: [labeled, synchronize, reopened]
env:
NODE_OPTIONS: '--max-old-space-size=6144'
jobs:
# iOS build job
build:
name: Test Build
if: |
github.event_name == 'push' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'e2e') &&
(github.event.action != 'labeled' || github.event.label.name == 'e2e'))
runs-on: macos-26-xlarge
concurrency:
group: e2e-ios-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
timeout-minutes: 45
outputs:
artifact-id: ${{ steps.build.outputs.artifact-id }}
steps:
- name: Checkout repo
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
- name: Build
id: build
uses: ./.github/actions/ios-build
with:
destination: simulator
is-testing: 'true'
enable-dev-mode: '0'
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-pkey-dotenv: ${{ secrets.DEPLOY_PKEY_DOTENV_REPO }}
deploy-pkey-scripts: ${{ secrets.DEPLOY_PKEY_SCRIPTS_REPO }}
deploy-pkey-sandbox: ${{ secrets.DEPLOY_PKEY_SANDBOX_REPO }}
ci-scripts: ${{ secrets.CI_SCRIPTS }}
# iOS e2e tests job
e2e-tests:
name: E2E Tests (Shard ${{ matrix.shard-index }})
needs: build
runs-on: macos-26-xlarge
strategy:
fail-fast: false
matrix:
shard-index: [1, 2, 3, 4]
concurrency:
group: e2e-ios-${{ github.workflow }}-${{ github.ref }}-shard-${{ matrix.shard-index }}
cancel-in-progress: false
timeout-minutes: 30
env:
SHARD_TOTAL: 4
SHARD_INDEX: ${{ matrix.shard-index }}
ARTIFACTS_FOLDER: e2e-artifacts
steps:
- name: Checkout repo
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
- name: Setup env key
uses: ./.github/actions/ssh/
with:
name: env
key: ${{ secrets.DEPLOY_PKEY_DOTENV_REPO }}
- name: Setup env
env:
SSH_AUTH_SOCK: /tmp/ssh_agent_env.sock
run: |
git clone git@github.com:rainbow-me/rainbow-env.git
mv rainbow-env/dotenv .env
rm -rf rainbow-env
- name: Install Maestro
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
with:
install_args: maestro
- name: Install Anvil
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de
with:
version: stable
- name: Download and Unpack IPA artifact
run: |
curl -L -H "Authorization: token ${{ github.token }}" -o artifact.zip "https://api.github.com/repos/${{ github.repository }}/actions/artifacts/${{ needs.build.outputs.artifact-id }}/zip"
unzip artifact.zip -d downloaded-artifacts
ls -l downloaded-artifacts
APP_ARCHIVE_PATH=$(find downloaded-artifacts -name "*.tar.gz" -print -quit)
tar -xzf "$APP_ARCHIVE_PATH" -C downloaded-artifacts
APP_PATH=$(find downloaded-artifacts -name "*.app" -type d | head -n 1)
echo "ARTIFACT_PATH_FOR_E2E=$APP_PATH" >> $GITHUB_ENV
- uses: futureware-tech/simulator-action@e89aa8f93d3aec35083ff49d2854d07f7186f7f5 # v5
id: simulator
with:
model: 'iPhone 17'
os_version: '26.4'
wait_for_boot: true
boot_timeout_seconds: 180
- name: Run Tests
run: ./scripts/e2e-ios-ci.sh
env:
DEVICE_UDID: ${{ steps.simulator.outputs.udid }}
- name: Upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: artifacts-${{ matrix.shard-index }}
path: ${{ env.ARTIFACTS_FOLDER }}
notify-failure:
name: Notify Slack on failure
needs: [build, e2e-tests]
if: |
always() &&
github.event_name == 'push' &&
github.ref == 'refs/heads/develop' &&
(needs.build.result == 'failure' || needs.e2e-tests.result == 'failure')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
- name: Notify Slack
uses: ./.github/actions/slack-notify-failure
with:
slack-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: ${{ vars.SLACK_CHANNEL_ID_FRONTEND_ALERTS }}
run-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}