-
Notifications
You must be signed in to change notification settings - Fork 645
/
bitrise.yml
481 lines (480 loc) · 15.7 KB
/
bitrise.yml
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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
---
format_version: '11'
default_step_lib_source: 'https://github.com/bitrise-io/bitrise-steplib.git'
project_type: android
trigger_map:
- push_branch: 'master'
pipeline: main-trigger-pipeline
- pull_request_source_branch: '*'
pipeline: main-trigger-pipeline
app:
envs:
- GRADLE_OPTS: -Dkotlin.incremental=false
pipelines:
main-trigger-pipeline:
stages:
- stage-trigger-run-all: { }
pipeline-connections-e2e-debug-tests:
stages:
- stage-build-connections-debug: { }
- stage-run-connections-e2e-tests: { }
- stage-notify-connections-e2e-failure: { }
pipeline-connections-e2e-release-tests:
stages:
- stage-build-connections-release: { }
- stage-run-connections-e2e-tests: { }
- stage-notify-connections-e2e-failure: { }
stages:
stage-trigger-run-all:
workflows:
- check: { }
- test: { }
- run-instrumentation-tests: { }
- run-paymentsheet-instrumentation-tests: { }
- run-example-instrumentation-tests: { }
- run-financial-connections-instrumentation-tests: { }
- run-connections-e2e-payments-tests-on-push: { }
- run-connections-e2e-token-tests-on-push: { }
- run-connections-e2e-data-tests-on-push: { }
- run-cardscan-instrumentation-tests: { }
- run-paymentsheet-end-to-end-tests: { }
- run-paymentsheet-screenshot-tests: { }
- check-dependencies: { }
stage-build-connections-debug:
workflows:
- build-connections-debug: { }
stage-build-connections-release:
workflows:
- build-connections-release: { }
stage-run-connections-e2e-tests:
workflows:
- run-connections-e2e-payments-tests: { }
- run-connections-e2e-data-tests: { }
- run-connections-e2e-token-tests: { }
- run-connections-e2e-livemode-tests: { }
stage-notify-connections-e2e-failure:
should_always_run: true
workflows:
- notify-connections-e2e-failure: { }
workflows:
check:
before_run:
- prepare_all
after_run:
- conclude_all
steps:
- script@1:
timeout: 1200
inputs:
- content: ./gradlew ktlint detekt lintRelease apiCheck verifyReleaseResources
test:
envs:
- opts:
is_expand: false
NEEDS_ROBOLECTRIC: true
- INCLUDE_PAPARAZZI_ON_FAILURE: true
before_run:
- prepare_all
after_run:
- conclude_all
steps:
- script@1:
timeout: 1200
inputs:
- content: ./gradlew testDebugUnitTest verifyPaparazziDebug -x :stripe-test-e2e:testDebugUnitTest --continue
build-connections-debug:
envs:
- BUILD_VARIANT: debug
before_run:
- _build-connections
build-connections-release:
envs:
- BUILD_VARIANT: release
before_run:
- _build-connections
_build-connections:
before_run:
- prepare_all
steps:
- android-build@1:
inputs:
- arguments: -PSTRIPE_FINANCIAL_CONNECTIONS_EXAMPLE_BACKEND_URL=$STRIPE_FINANCIAL_CONNECTIONS_EXAMPLE_BACKEND_URL
- module: financial-connections-example
- variant: $BUILD_VARIANT
- build_type: apk
- cache_level: all
- deploy-to-bitrise-io@2:
inputs:
- pipeline_intermediate_files: "$BITRISE_APK_PATH:BITRISE_APK_PATH"
run-connections-e2e-payments-tests:
envs:
- MAESTRO_TAGS: testmode-payments
before_run:
- _run-connections-e2e-tests
run-connections-e2e-data-tests:
envs:
- MAESTRO_TAGS: testmode-data
before_run:
- _run-connections-e2e-tests
run-connections-e2e-token-tests:
envs:
- MAESTRO_TAGS: testmode-token
before_run:
- _run-connections-e2e-tests
run-connections-e2e-payments-tests-on-push:
envs:
- MAESTRO_TAGS: testmode-payments
before_run:
- _build-connections
- _run-connections-e2e-tests
run-connections-e2e-data-tests-on-push:
envs:
- MAESTRO_TAGS: testmode-data
before_run:
- _build-connections
- _run-connections-e2e-tests
run-connections-e2e-token-tests-on-push:
envs:
- MAESTRO_TAGS: testmode-token
before_run:
- _build-connections
- _run-connections-e2e-tests
run-connections-e2e-livemode-tests:
envs:
- MAESTRO_TAGS: livemode-data
before_run:
- _run-connections-e2e-tests
_run-connections-e2e-tests:
before_run:
- start_connections_emulator
- prepare_all
after_run:
- conclude_all
steps:
- wait-for-android-emulator@1:
inputs:
- boot_timeout: 600
- pull-intermediate-files@1:
inputs:
- artifact_sources: .*
- script@1:
title: Execute Maestro tests
inputs:
- content: |-
#!/usr/bin/env bash
bash ./scripts/execute_maestro_tests.sh -t $MAESTRO_TAGS
notify-connections-e2e-failure:
steps:
# Notify all executions.
- slack@4:
inputs:
- webhook_url: $WEBHOOK_SLACK_CONNECTIONS_MOBILE
- webhook_url_on_error: $WEBHOOK_SLACK_CONNECTIONS_MOBILE
# Notify failures.
- slack@4:
run_if: '{{ getenv "BITRISEIO_PIPELINE_BUILD_STATUS" | eq "failed" }}'
inputs:
- webhook_url: $WEBHOOK_SLACK_CUX_BOTS
- webhook_url_on_error: $WEBHOOK_SLACK_CUX_BOTS
- pagerduty@0:
run_if: '{{ getenv "BITRISEIO_PIPELINE_BUILD_STATUS" | eq "failed" }}'
inputs:
- event_description: Android E2E tests failing! $BITRISE_BUILD_URL
- integration_key: $AUX_PAGERDUTY_INTEGRATION_KEY
maestro-paymentsheet:
before_run:
- start_emulator
- prepare_all
after_run:
- conclude_all
steps:
- wait-for-android-emulator@1:
inputs:
- boot_timeout: 600
- script@1:
title: Execute Maestro tests
inputs:
- content: |-
#!/usr/bin/env bash
bash ./scripts/execute_maestro_elements_tests.sh paymentsheet
- slack@3:
is_always_run: true
run_if: .IsBuildFailed
inputs:
- webhook_url: $WEBHOOK_SLACK_ELEMENTS_MAESTRO
- webhook_url_on_error: $WEBHOOK_SLACK_ELEMENTS_MAESTRO
- custom-test-results-export@1:
inputs:
- search_pattern: '*/maestroReport.xml'
- test_name: Maestro tests
- deploy-to-bitrise-io@2: { }
maestro-customersheet:
before_run:
- start_emulator
- prepare_all
after_run:
- conclude_all
steps:
- wait-for-android-emulator@1:
inputs:
- boot_timeout: 600
- script@1:
title: Execute Maestro tests
inputs:
- content: |-
#!/usr/bin/env bash
bash ./scripts/execute_maestro_elements_tests.sh customersheet
- slack@3:
is_always_run: true
run_if: .IsBuildFailed
inputs:
- webhook_url: $WEBHOOK_SLACK_ELEMENTS_MAESTRO
- webhook_url_on_error: $WEBHOOK_SLACK_ELEMENTS_MAESTRO
- custom-test-results-export@1:
inputs:
- search_pattern: '*/maestroReport.xml'
- test_name: Maestro tests
- deploy-to-bitrise-io@2: { }
run-instrumentation-tests:
before_run:
- start_emulator
- prepare_all
after_run:
- conclude_all
steps:
- script@1:
title: Assemble Instrumentation tests
timeout: 600
inputs:
- content: ./gradlew assembleAndroidTest -x :paymentsheet-example:assembleAndroidTest -x :paymentsheet:assembleAndroidTest -x :example:assembleAndroidTest -x :financial-connections:assembleAndroidTest -x :financial-connections-example:assembleAndroidTest -x :camera-core:assembleAndroidTest -x :stripecardscan:assembleAndroidTest -x :stripecardscan-example:assembleAndroidTest
- wait-for-android-emulator@1:
inputs:
- boot_timeout: 600
- script@1:
title: Execute instrumentation tests
timeout: 1200
inputs:
- content: ./gradlew connectedAndroidTest -x :paymentsheet-example:connectedAndroidTest -x :paymentsheet:connectedAndroidTest -x :example:connectedAndroidTest -x :financial-connections:connectedAndroidTest -x :financial-connections-example:connectedAndroidTest -x :camera-core:connectedAndroidTest -x :stripecardscan:connectedAndroidTest -x :stripecardscan-example:connectedAndroidTest
run-paymentsheet-screenshot-tests:
envs:
- INCLUDE_SCREENSHOT_ON_FAILURE: true
before_run:
- start_screenshot_emulator
- prepare_all
after_run:
- conclude_all
steps:
- script@1:
title: Assemble Instrumentation tests
timeout: 600
inputs:
- content: ./gradlew :paymentsheet:assembleAndroidTest
- wait-for-android-emulator@1:
inputs:
- boot_timeout: 600
- script@1:
title: Execute instrumentation tests
timeout: 1200
inputs:
- content: ./gradlew paymentsheet-example:executeScreenshotTests -Precord -Pandroid.testInstrumentationRunnerArguments.package=com.stripe.android.screenshot -Dorg.gradle.jvmargs="--add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio.channels=ALL-UNNAMED --add-exports java.base/sun.nio.ch=ALL-UNNAMED"
- script@1:
title: Check updated screenshots
inputs:
- content: ruby scripts/check_for_changed_paymentsheet_screenshots.rb
run-paymentsheet-instrumentation-tests:
before_run:
- start_emulator
- prepare_all
after_run:
- conclude_all
steps:
- script@1:
title: Execute instrumentation tests
timeout: 1200
inputs:
- content: ./gradlew :paymentsheet:pixel2api33DebugAndroidTest
run-example-instrumentation-tests:
before_run:
- start_emulator
- prepare_all
after_run:
- conclude_all
steps:
- script@1:
title: Assemble Instrumentation tests
timeout: 600
inputs:
- content: ./gradlew :example:assembleAndroidTest
- wait-for-android-emulator@1:
inputs:
- boot_timeout: 600
- script@1:
title: Execute instrumentation tests
timeout: 1200
inputs:
- content: ./gradlew :example:connectedAndroidTest
run-financial-connections-instrumentation-tests:
before_run:
- start_emulator
- prepare_all
after_run:
- conclude_all
steps:
- script@1:
title: Assemble Instrumentation tests
timeout: 600
inputs:
- content: ./gradlew :financial-connections:assembleAndroidTest :financial-connections-example:assembleAndroidTest
- wait-for-android-emulator@1:
inputs:
- boot_timeout: 600
- script@1:
title: Execute instrumentation tests
timeout: 1200
inputs:
- content: ./gradlew :financial-connections:connectedAndroidTest :financial-connections-example:connectedAndroidTest
run-cardscan-instrumentation-tests:
before_run:
- start_emulator
- prepare_all
after_run:
- conclude_all
steps:
- script@1:
title: Assemble Instrumentation tests
timeout: 600
inputs:
- content: ./gradlew :camera-core:assembleAndroidTest :stripecardscan:assembleAndroidTest :stripecardscan-example:assembleAndroidTest
- wait-for-android-emulator@1:
inputs:
- boot_timeout: 600
- script@1:
title: Execute instrumentation tests
timeout: 1200
inputs:
- content: ./gradlew :camera-core:connectedAndroidTest :stripecardscan:connectedAndroidTest :stripecardscan-example:connectedAndroidTest
run-paymentsheet-end-to-end-tests:
before_run:
- prepare_all
after_run:
- conclude_all
steps:
- script@1:
timeout: 1200
inputs:
- content: ./gradlew :paymentsheet-example:assembleDebugAndroidTest :paymentsheet-example:assembleDebug -PIS_BROWSERSTACK_BUILD=true
- script@1:
timeout: 120
inputs:
- content: pip3 install requests_toolbelt requests
- script@1:
timeout: 2400
inputs:
- content: python3 scripts/browserstack.py --test --apk paymentsheet-example/build/outputs/apk/debug/paymentsheet-example-debug.apk --espresso paymentsheet-example/build/outputs/apk/androidTest/debug/paymentsheet-example-debug-androidTest.apk --num-retries 2
check-dependencies:
envs:
- INCLUDE_DEPENDENCIES_ON_FAILURE: true
before_run:
- prepare_all
after_run:
- conclude_all
steps:
- script@1:
inputs:
- content: ruby scripts/dependencies/update_transitive_dependencies.rb
- script@1:
inputs:
- content: ruby scripts/dependencies/check_transitive_dependencies.rb
start_connections_emulator:
steps:
- avd-manager@1:
inputs:
- profile: "pixel_3a"
- abi: "x86_64"
- api_level: 32
- tag: "google_apis"
- start_command_flags: >
-camera-back none
-camera-front none
-netdelay none
-netspeed full
-memory 2048
-no-snapshot
-no-audio
-no-window
start_emulator:
steps:
- avd-manager@1:
inputs:
- profile: "pixel_6"
- abi: "x86_64"
- api_level: 33
- tag: "google_apis"
- start_command_flags: >
-camera-back none
-camera-front none
-netdelay none
-netspeed full
-memory 2048
-no-snapshot
-no-audio
-no-window
start_screenshot_emulator:
steps:
- avd-manager@1:
inputs:
- profile: "Nexus 6"
- abi: "x86_64"
- api_level: 28
- start_command_flags: >
-camera-back none
-camera-front none
-netdelay none
-netspeed full
-memory 2048
-no-snapshot
-no-audio
-no-window
-no-snapshot-save
-gpu swiftshader_indirect
-no-boot-anim
prepare_all:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@8: { }
- cache-pull@2: { }
- restore-gradle-cache@1: { }
- set-java-version@1:
inputs:
- set_java_version: 21
- script@1:
inputs:
- content: mkdir -p ~/.gradle ; cp .bitrise/ci-gradle.properties ~/.gradle/gradle.properties
- script@1:
inputs:
- content: echo "STRIPE_EXAMPLE_BACKEND_URL=$STRIPE_EXAMPLE_BACKEND_URL" >> ~/.gradle/gradle.properties; echo "STRIPE_EXAMPLE_PUBLISHABLE_KEY=$STRIPE_EXAMPLE_PUBLISHABLE_KEY" >> ~/.gradle/gradle.properties
- activate-build-cache-for-gradle:
inputs:
- push: 'true'
- validation_level: warning
conclude_all:
steps:
- script-runner@0:
is_always_run: true
title: Copy test results to tmp
inputs:
- file_path: ./scripts/copy_test_results_to_tmp.sh
- deploy-to-bitrise-io@2:
inputs:
- notify_user_groups: none
- is_compress: "true"
- deploy_path: /tmp/test_results
- is_enable_public_page: "false"
title: Deploy test results artifacts
- cache-push@2: { }
- save-gradle-cache@1: { }
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite