forked from MetaMask/metamask-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-e2e-smoke-tests-android.yml
More file actions
365 lines (338 loc) · 12.3 KB
/
run-e2e-smoke-tests-android.yml
File metadata and controls
365 lines (338 loc) · 12.3 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
name: Android E2E Smoke Tests
on:
workflow_call:
inputs:
selected_tags:
description: 'JSON array of selected tags from Smart E2E selection (e.g., ["SmokeAccounts", "SmokeSwap"])'
required: false
type: string
default: '["ALL"]'
changed_files:
description: 'Changed files'
required: false
type: string
default: ''
runner_provider:
description: Runner provider forwarded from the caller
required: false
type: string
default: current
permissions:
contents: read
id-token: write
jobs:
swap-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeSwap')
strategy:
matrix:
split: [1, 2]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: swap-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeSwap'
split_number: ${{ matrix.split }}
total_splits: 2
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
stake-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeStake')
strategy:
matrix:
split: [1]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: stake-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeStake'
split_number: ${{ matrix.split }}
total_splits: 1
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
perps-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokePerps')
strategy:
matrix:
split: [1]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: perps-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokePerps'
split_number: ${{ matrix.split }}
total_splits: 1
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
wallet-platform-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeWalletPlatform')
strategy:
matrix:
split: [1, 2, 3]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: wallet-platform-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeWalletPlatform'
split_number: ${{ matrix.split }}
total_splits: 3
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
identity-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeIdentity')
strategy:
matrix:
split: [1, 2]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: identity-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeIdentity'
split_number: ${{ matrix.split }}
total_splits: 2
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
accounts-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeAccounts')
strategy:
matrix:
split: [1]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: accounts-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeAccounts'
split_number: ${{ matrix.split }}
total_splits: 1
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
network-abstraction-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeNetworkAbstractions')
strategy:
matrix:
split: [1, 2]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: network-abstraction-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeNetworkAbstractions'
split_number: ${{ matrix.split }}
total_splits: 2
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
network-expansion-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeNetworkExpansion')
strategy:
matrix:
split: [1, 2]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: network-expansion-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeNetworkExpansion'
split_number: ${{ matrix.split }}
total_splits: 2
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
confirmations-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeConfirmations')
strategy:
matrix:
split: [1, 2, 3, 4]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: confirmations-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeConfirmations'
split_number: ${{ matrix.split }}
total_splits: 4
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
prediction-market-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokePredictions')
strategy:
matrix:
split: [1]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: prediction-market-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokePredictions'
split_number: ${{ matrix.split }}
total_splits: 1
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
money-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeMoney')
strategy:
matrix:
split: [1]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: money-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeMoney'
split_number: ${{ matrix.split }}
total_splits: 1
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
multichain-api-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeMultiChainAPI')
strategy:
matrix:
split: [1]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: multichain-api-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeMultiChainAPI'
split_number: ${{ matrix.split }}
total_splits: 1
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
seedless-onboarding-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeSeedlessOnboarding')
strategy:
matrix:
split: [1]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: seedless-onboarding-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeSeedlessOnboarding'
split_number: ${{ matrix.split }}
total_splits: 1
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
browser-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeBrowser')
strategy:
matrix:
split: [1]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: browser-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeBrowser'
split_number: ${{ matrix.split }}
total_splits: 1
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
snaps-android-smoke:
if: contains(fromJson(inputs.selected_tags), 'ALL') || contains(fromJson(inputs.selected_tags), 'SmokeSnaps')
strategy:
matrix:
split: [1, 2, 3, 4]
fail-fast: false
uses: ./.github/workflows/run-e2e-workflow.yml
with:
test-suite-name: snaps-android-smoke-${{ matrix.split }}
platform: android
test_suite_tag: 'SmokeSnaps'
split_number: ${{ matrix.split }}
total_splits: 4
changed_files: ${{ inputs.changed_files }}
runner_provider: ${{ inputs.runner_provider }}
secrets: inherit
report-android-smoke-tests:
name: Report Android Smoke Tests
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
if: ${{ !cancelled() && inputs.selected_tags != '[]' && inputs.selected_tags != '["FlaskBuildTests"]' }}
needs:
- swap-android-smoke
- stake-android-smoke
- perps-android-smoke
- wallet-platform-android-smoke
- identity-android-smoke
- accounts-android-smoke
- network-abstraction-android-smoke
- network-expansion-android-smoke
- confirmations-android-smoke
- prediction-market-android-smoke
- money-android-smoke
- multichain-api-android-smoke
- seedless-onboarding-android-smoke
- browser-android-smoke
- snaps-android-smoke
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Download shards test artifacts (XMLs + Screenshots)
uses: actions/download-artifact@v4
continue-on-error: true
with:
path: all-test-artifacts/
pattern: 'test-e2e-main-*-android-*'
- name: Post Test Report
uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3
with:
name: 'Android E2E Smoke Test Results'
path: 'all-test-artifacts/**/junit.xml'
reporter: 'jest-junit'
fail-on-error: false
list-suites: 'failed'
list-tests: 'failed'
- name: Upload all test artifacts (XMLs + Screenshots)
uses: actions/upload-artifact@v4
with:
name: e2e-smoke-android-all-test-artifacts
path: all-test-artifacts/
retention-days: 7
- name: Create mobile JSON test report
id: create-json-report
continue-on-error: true
run: |
# Create a temporary directory for xml2js to avoid conflicts
mkdir -p temp-deps && cd temp-deps
npm init -y
npm install xml2js@0.5.0 --no-audit --no-fund
# Copy node_modules to workspace
cp -r node_modules ${{ github.workspace }}/
# Run the mobile test report generator
cd ${{ github.workspace }}
TEST_RESULTS_PATH=all-test-artifacts \
TEST_RUNS_PATH=test/test-results/test-runs-android.json \
RUN_ID=${{ github.run_id }} \
PR_NUMBER=${{ github.event.pull_request.number || '0' }} \
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
node .github/scripts/e2e-create-json-test-report.mjs
# Clean up temporary node_modules
rm -rf node_modules
- name: Upload JSON test report
if: steps.create-json-report.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: test-e2e-android-json-report
path: test/test-results/test-runs-android.json
retention-days: 7