-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
bitrise.yml
1627 lines (1587 loc) · 58 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
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
format_version: '8'
default_step_lib_source: 'https://github.com/bitrise-io/bitrise-steplib.git'
project_type: react-native
#Pipelines are listed below
pipelines:
#Creates MetaMask-QA apps and stores apk/ipa in Bitrise
create_qa_builds_pipeline:
stages:
- create_build_qa: {}
#Builds MetaMask, MetaMask-QA apps and stores apk/ipa in Bitrise
build_all_targets_pipeline:
stages:
- create_build_all_targets: {}
#Releases MetaMask apps and stores apk/ipa into Play(Internal Testing)/App(TestFlight) Store
release_builds_to_store_pipeline:
stages:
- create_build_release: {}
- deploy_build_release: {}
- create_build_qa: {} #Generate QA builds for E2E app upgrade tests
#Releases MetaMask apps and stores ipa into App(TestFlight) Store
release_ios_to_store_pipeline:
stages:
- create_ios_release: {}
- deploy_ios_release: {}
#Releases MetaMask apps and stores apk Play(Internal Testing) Store
release_android_to_store_pipeline:
stages:
- create_android_release: {}
- deploy_android_release: {}
#Run E2E test suite for iOS only
run_e2e_ios_pipeline:
stages:
- build_e2e_ios_stage: {}
- run_e2e_ios_stage: {}
- notify: {}
#Run E2E test suite for Android only
run_e2e_android_pipeline:
stages:
- build_e2e_android_stage: {} #builds android detox E2E
- run_e2e_android_stage: {} #runs android detox test E2E
- notify: {}
#PR_e2e_verfication (build ios & android), run iOS (smoke), emulator Android
release_e2e_pipeline:
stages:
- build_e2e_ios_android_stage: {}
- run_release_e2e_ios_android_stage: {}
- notify: {}
#PR_e2e_verfication (build ios & android), run iOS (smoke), emulator Android
pr_smoke_e2e_pipeline:
stages:
- build_smoke_e2e_ios_android_stage: {}
- run_smoke_e2e_ios_android_stage: {}
- notify: {}
#PR_e2e_verfication (build ios & android), run iOS (regression), emulator Android
pr_regression_e2e_pipeline:
stages:
- build_regression_e2e_ios_android_stage: {}
- run_regression_e2e_ios_android_stage: {}
- notify: {}
#App launch times pipeline. Runs on browserstack
app_launch_times_pipeline:
stages:
- create_build_qa_android: {}
- app_launch_times_test_stage: {}
#App Upgrade pipeline. Runs on browserstack
app_upgrade_pipeline:
stages:
- create_build_qa_android: {}
- app_upgrade_test_stage: {}
# Pipeline for Flask
create_flask_release_builds_pipeline:
stages:
- create_build_flask_release: {}
- notify: {}
release_flask_builds_to_store_pipeline:
stages:
- create_build_flask_release: {}
- deploy_flask_build_release: {}
- release_notify: {}
#Stages reference workflows. Those workflows cannot but utility "_this-is-a-utility"
stages:
create_build_all_targets:
workflows:
- build_android_release: {}
- build_ios_release: {}
- build_android_qa: {}
- build_ios_qa: {}
create_build_release:
workflows:
- build_android_release: {}
- build_ios_release: {}
deploy_build_release:
workflows:
- deploy_android_to_store: {}
- deploy_ios_to_store: {}
create_ios_release:
workflows:
- build_ios_release: {}
deploy_ios_release:
workflows:
- deploy_ios_to_store: {}
create_android_release:
workflows:
- build_android_release: {}
deploy_android_release:
workflows:
- deploy_android_to_store: {}
create_build_qa:
workflows:
- build_android_qa: {}
- build_ios_qa: {}
create_build_qa_android:
workflows:
- build_android_qa: {}
create_build_qa_ios:
workflows:
- build_ios_qa: {}
build_e2e_ios_stage:
workflows:
- ios_e2e_build: {}
run_e2e_ios_stage:
workflows:
- ios_e2e_test: {}
build_smoke_e2e_ios_android_stage:
abort_on_fail: true
workflows:
- ios_e2e_build: {}
- android_e2e_build: {}
run_smoke_e2e_ios_android_stage:
workflows:
- run_ios_api_specs: {}
- run_tag_smoke_accounts_ios: {}
- run_tag_smoke_accounts_android: {}
# - run_tag_smoke_notifications_ios: {}
# - run_tag_smoke_notifications_android: {}
# - run_tag_smoke_assets_ios: {}
- run_tag_smoke_assets_android: {}
- run_tag_smoke_confirmations_ios: {}
- run_tag_smoke_confirmations_android: {}
# - run_tag_smoke_swaps_ios: {}
# - run_tag_smoke_swaps_android: {}
- run_tag_smoke_core_ios: {}
- run_tag_smoke_core_android: {}
build_regression_e2e_ios_android_stage:
workflows:
- ios_e2e_build: {}
- android_e2e_build: {}
run_regression_e2e_ios_android_stage:
workflows:
- ios_run_regression_tests: {}
- android_run_regression_tests: {}
run_release_e2e_ios_android_stage:
workflows:
- ios_run_regression_tests: {}
- android_run_regression_tests: {}
- run_tag_smoke_confirmations_ios: {}
- run_tag_smoke_confirmations_android: {}
- run_tag_smoke_accounts_ios: {}
- run_tag_smoke_accounts_android: {}
- run_tag_smoke_notifications_ios: {}
- run_tag_smoke_notifications_android: {}
- run_tag_smoke_assets_ios: {}
- run_tag_smoke_assets_android: {}
- run_tag_smoke_swaps_ios: {}
- run_tag_smoke_swaps_android: {}
- run_tag_smoke_core_ios: {}
- run_tag_smoke_core_android: {}
- run_tag_upgrade_android: {}
- run_android_app_launch_times_appium_test: {}
run_e2e_ios_android_stage:
workflows:
- ios_e2e_test: {}
- android_e2e_test: {}
build_e2e_ios_android_stage:
workflows:
- build_android_qa: {}
- ios_e2e_build: {}
- android_e2e_build: {}
build_e2e_android_stage:
workflows:
- android_e2e_build: {}
run_e2e_android_stage:
workflows:
- android_e2e_test: {}
notify:
workflows:
- notify_success: {}
app_launch_times_test_stage:
workflows:
- run_android_app_launch_times_appium_test: {}
app_upgrade_test_stage:
workflows:
- run_tag_upgrade_android: {}
release_notify:
workflows:
- release_announcing_stores: {}
create_build_flask_release:
workflows:
- build_android_flask_release: {}
- build_ios_flask_release: {}
deploy_flask_build_release:
workflows:
- deploy_android_to_store:
envs:
- MM_ANDROID_PACKAGE_NAME: 'io.metamask.flask'
- deploy_ios_to_store:
workflows:
# Code Setups
setup:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
set_commit_hash:
steps:
- script@1:
title: Set commit hash env variable
inputs:
- content: |-
#!/usr/bin/env bash
BRANCH_COMMIT_HASH="$(git rev-parse HEAD)"
# Log the value of BRANCH_COMMIT_HASH
echo "BRANCH_COMMIT_HASH is set to: $BRANCH_COMMIT_HASH"
envman add --key BRANCH_COMMIT_HASH --value "$BRANCH_COMMIT_HASH"
- share-pipeline-variable@1:
title: Persist commit hash across all stages
inputs:
- variables: |-
BRANCH_COMMIT_HASH
code_setup:
before_run:
- setup
- prep_environment
steps:
- restore-cocoapods-cache@2: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
envman add --key YARN_CACHE_DIR --value "$(yarn cache dir)"
title: Get Yarn cache directory
- yarn@0:
inputs:
- command: setup
title: Yarn Setup
prep_environment:
steps:
- restore-cache@2:
title: Restore Node
inputs:
- key: node-{{ getenv "NODE_VERSION" }}-{{ .OS }}-{{ .Arch }}
- script@1:
title: node, yarn, corepack installation
inputs:
- content: |-
#!/usr/bin/env bash
echo "Gems being installed with bundler gem"
bundle install --gemfile=ios/Gemfile
echo "Node $NODE_VERSION being installed"
set -e
# Add and enable NVM
wget -O install-nvm.sh "https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh"
echo "${NVM_SHA256SUM} install-nvm.sh" > install-nvm.sh.SHA256SUM
sha256sum -c install-nvm.sh.SHA256SUM
chmod +x install-nvm.sh && ./install-nvm.sh && rm ./install-nvm.sh
source "${HOME}/.nvm/nvm.sh"
echo 'source "${HOME}/.nvm/nvm.sh"' | tee -a ${HOME}/.{bashrc,profile}
# Retry logic for Node installation
MAX_ATTEMPTS=3
ATTEMPT=1
until [ $ATTEMPT -gt $MAX_ATTEMPTS ]
do
echo "Attempt $ATTEMPT to install Node.js"
nvm install ${NODE_VERSION}
INSTALL_STATUS=$? # Capture the exit status of the nvm install command
if [ $INSTALL_STATUS -eq 0 ]; then
echo "Node.js installation successful!"
break
else
echo "Node.js installation failed with exit code $INSTALL_STATUS"
ATTEMPT=$((ATTEMPT+1))
echo "Node.js installation failed, retrying in 5 seconds..."
sleep 5
fi
done
if [ $ATTEMPT -gt $MAX_ATTEMPTS ]; then
echo "Node.js installation failed after $MAX_ATTEMPTS attempts."
exit 1
fi
envman add --key PATH --value $PATH
node --version
echo "Corepack being installed with npm"
npm i -g "corepack@$COREPACK_VERSION"
echo "Corepack enabling $YARN_VERSION"
corepack enable
- save-cache@1:
title: Save Node
inputs:
- key: node-{{ getenv "NODE_VERSION" }}-{{ .OS }}-{{ .Arch }}
- paths: |-
../.nvm/
../../../root/.nvm/
install_applesimutils:
steps:
- script@1:
title: applesimutils installation
inputs:
- content: |-
#!/usr/bin/env bash
echo "Now installing applesimutils..."
brew tap wix/brew
brew install applesimutils
# Notifications utility workflows
# Provides values for commit or branch message and path depending on commit env setup initialised or not
_get_workflow_info:
steps:
- activate-ssh-key@4:
is_always_run: true # always run to also feed failure notifications
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6:
inputs:
- update_submodules: 'no'
is_always_run: true # always run to also feed failure notifications
- script@1:
is_always_run: true # always run to also feed failure notifications
inputs:
- content: |
#!/bin/bash
# generate reference to commit from env or using git
COMMIT_SHORT_HASH="${BITRISE_GIT_COMMIT:0:7}"
BRANCH_HEIGHT=''
WORKFLOW_TRIGGER='Push'
if [[ -z "$BITRISE_GIT_COMMIT" ]]; then
COMMIT_SHORT_HASH="$(git rev-parse --short HEAD)"
BRANCH_HEIGHT='HEAD'
WORKFLOW_TRIGGER='Manual'
fi
envman add --key COMMIT_SHORT_HASH --value "$COMMIT_SHORT_HASH"
envman add --key BRANCH_HEIGHT --value "$BRANCH_HEIGHT"
envman add --key WORKFLOW_TRIGGER --value "$WORKFLOW_TRIGGER"
title: Get commit or branch name and path variables
# Slack notification utils: we have two workflows to allow choosing when to notify: on success, on failure or both.
# A workflow for instance create_qa_builds will notify on failure for each build_android_qa or build_ios_qa
# but will only notify success if both success and create_qa_builds succeeds.
# Send a Slack message on successful release
release_announcing_stores:
before_run:
- code_setup
steps:
- yarn@0:
inputs:
- command: build:announce
title: Announcing pre-release
is_always_run: false
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: standard
# Send a Slack message when workflow succeeds
notify_success:
before_run:
- _get_workflow_info
steps:
# Update Bitrise comment in PR with success status
- comment-on-github-pull-request@0:
is_always_run: true
run_if: '{{getenv "TRIGGERED_BY_PR_LABEL" | eq "true"}}'
inputs:
- personal_access_token: '$GITHUB_ACCESS_TOKEN'
- body: |-
## [<img alt="https://bitrise.io/" src="https://assets-global.website-files.com/5db35de024bb983af1b4e151/5e6f9ccc3e129dfd8a205e4e_Bitrise%20Logo%20-%20Eggplant%20Bg.png" height="20">](${BITRISEIO_PIPELINE_BUILD_URL}) **Bitrise**
✅✅✅ `${BITRISEIO_PIPELINE_TITLE}` passed on Bitrise! ✅✅✅
Commit hash: ${GITHUB_PR_HASH}
Build link: ${BITRISEIO_PIPELINE_BUILD_URL}
>[!NOTE]
>- You can kick off another `${BITRISEIO_PIPELINE_TITLE}` on Bitrise by removing and re-applying the `Run Smoke E2E` label on the pull request
<!-- BITRISE_TAG -->
<!-- BITRISE_SUCCESS_TAG -->
- repository_url: '$GIT_REPOSITORY_URL'
- issue_number: '$GITHUB_PR_NUMBER'
- api_base_url: 'https://api.github.com'
- update_comment_tag: '$GITHUB_PR_HASH'
# Send a Slack message when workflow fails
notify_failure:
before_run:
- _get_workflow_info
steps:
- script@1:
is_always_run: true
title: Check if PR comment should be updated
inputs:
- content: |-
#!/usr/bin/env bash
if [[ "$TRIGGERED_BY_PR_LABEL" == "true" && $BITRISE_BUILD_STATUS == 1 ]]; then
envman add --key SHOULD_UPDATE_PR_COMMENT --value "true"
else
envman add --key SHOULD_UPDATE_PR_COMMENT --value "false"
fi
# Update Bitrise comment in PR with failure status
- comment-on-github-pull-request@0:
is_always_run: true
run_if: '{{getenv "SHOULD_UPDATE_PR_COMMENT" | eq "true"}}'
inputs:
- personal_access_token: '$GITHUB_ACCESS_TOKEN'
- body: |-
## [<img alt="https://bitrise.io/" src="https://assets-global.website-files.com/5db35de024bb983af1b4e151/5e6f9ccc3e129dfd8a205e4e_Bitrise%20Logo%20-%20Eggplant%20Bg.png" height="20">](${BITRISEIO_PIPELINE_BUILD_URL}) **Bitrise**
❌❌❌ `${BITRISEIO_PIPELINE_TITLE}` failed on Bitrise! ❌❌❌
Commit hash: ${GITHUB_PR_HASH}
Build link: ${BITRISEIO_PIPELINE_BUILD_URL}
>[!NOTE]
>- You can kick off another `${BITRISEIO_PIPELINE_TITLE}` on Bitrise by removing and re-applying the `Run Smoke E2E` label on the pull request
> [!TIP]
>- Check the [documentation](https://www.notion.so/metamask-consensys/Bitrise-Pipeline-Overview-43159500c43748a389556f0593e8834b#26052f2ea6e24f8c9cfdb57a7522dc1f) if you have any doubts on how to understand the failure on bitrise
<!-- BITRISE_TAG -->
<!-- BITRISE_FAIL_TAG -->
- repository_url: '$GIT_REPOSITORY_URL'
- issue_number: '$GITHUB_PR_NUMBER'
- api_base_url: 'https://api.github.com'
- update_comment_tag: '$GITHUB_PR_HASH'
# CI Steps
ci_test:
before_run:
- code_setup
steps:
- yarn@0:
inputs:
- args: ''
- command: test:unit --silent
title: Unit Test
is_always_run: false
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
echo 'weew - everything passed!'
title: All Tests Passed
is_always_run: false
# E2E Steps
### This workflow uses a flag (TEST_SUITE) that defines the specific set of tests to be run.
## in this instance Regression. In future iterations we can rename to ios_test_suite_selection & android_test_suite_selection
ios_build_regression_tests:
envs:
- TEST_SUITE: 'Regression'
after_run:
- ios_e2e_build
ios_run_regression_tests:
envs:
- TEST_SUITE: 'Regression'
after_run:
- ios_e2e_test
android_build_regression_tests:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE: 'Regression'
after_run:
- android_e2e_build
android_run_regression_tests:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE: 'Regression'
after_run:
- android_e2e_test
run_tag_upgrade_android:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- PRODUCTION_APP_URL: 'bs://46f0542276828b691f56adec25ac81065b5abf73' # Last production's QA build
- PRODUCTION_BUILD_NAME: 7.30.0
- PRODUCTION_BUILD_NUMBER: 1410
- CUCUMBER_TAG_EXPRESSION: '@upgrade and @androidApp'
- PRODUCTION_BUILD_STRING: 'MetaMask-QA v$PRODUCTION_BUILD_NAME ($PRODUCTION_BUILD_NUMBER)'
- NEW_BUILD_STRING: 'MetaMask-QA v$VERSION_NAME ($VERSION_NUMBER)'
- TEST_TYPE: 'upgrade'
after_run:
- wdio_android_e2e_test
run_android_app_launch_times_appium_test:
envs:
- TEST_TYPE: 'performance'
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
after_run:
- wdio_android_e2e_test
### Separating workflows so they run concurrently during smoke runs
run_tag_smoke_accounts_ios:
envs:
- TEST_SUITE_FOLDER: './e2e/specs/accounts/*'
- TEST_SUITE_TAG: '.*SmokeAccounts.*'
after_run:
- ios_e2e_test
run_tag_smoke_accounts_android:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE_FOLDER: './e2e/specs/accounts/*'
- TEST_SUITE_TAG: '.*SmokeAccounts.*'
after_run:
- android_e2e_test
run_tag_smoke_notifications_ios:
envs:
- TEST_SUITE_FOLDER: './e2e/specs/notifications/*'
- TEST_SUITE_TAG: '.*SmokeNotifications.*'
after_run:
- ios_e2e_test
run_tag_smoke_notifications_android:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE_FOLDER: './e2e/specs/notifications/*'
- TEST_SUITE_TAG: '.*SmokeNotifications.*'
after_run:
- android_e2e_test
run_tag_smoke_assets_ios:
envs:
- TEST_SUITE_FOLDER: './e2e/specs/assets/*'
- TEST_SUITE_TAG: '.*SmokeAssets.*'
after_run:
- ios_e2e_test
run_tag_smoke_assets_android:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE_FOLDER: './e2e/specs/assets/*'
- TEST_SUITE_TAG: '.*SmokeAssets.*'
after_run:
- android_e2e_test
run_tag_smoke_confirmations_ios:
envs:
- TEST_SUITE_FOLDER: './e2e/specs/confirmations/*'
- TEST_SUITE_TAG: '.*SmokeConfirmations.*'
after_run:
- ios_e2e_test
run_tag_smoke_confirmations_android:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE_FOLDER: './e2e/specs/confirmations/*'
- TEST_SUITE_TAG: '.*SmokeConfirmations.*'
after_run:
- android_e2e_test
run_tag_smoke_swaps_ios:
envs:
- TEST_SUITE_FOLDER: './e2e/specs/swaps/*'
- TEST_SUITE_TAG: '.*SmokeSwaps.*'
after_run:
- ios_e2e_test
run_tag_smoke_swaps_android:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE_FOLDER: './e2e/specs/swaps/*'
- TEST_SUITE_TAG: '.*SmokeSwaps.*'
after_run:
- android_e2e_test
run_ios_api_specs:
after_run:
- ios_api_specs
run_tag_smoke_core_ios:
envs:
- TEST_SUITE_FOLDER: './e2e/spec/*/**/*'
- TEST_SUITE_TAG: '.*SmokeCore.*'
after_run:
- ios_e2e_test
run_tag_smoke_core_android:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE_FOLDER: './e2e/spec/*/**/*'
- TEST_SUITE_TAG: '.*SmokeCore.*'
after_run:
- android_e2e_test
android_e2e_build:
before_run:
- code_setup
- set_commit_hash
after_run:
- notify_failure
steps:
- script@1:
title: Generating ccache key using native folder checksum
inputs:
- content: |-
#!/usr/bin/env bash
./scripts/cache/set-cache-envs.sh android
- restore-gradle-cache@2: {}
- install-missing-android-tools@3:
inputs:
- ndk_version: $NDK_VERSION
- gradlew_path: $PROJECT_LOCATION/gradlew
- file-downloader@1:
inputs:
- source: $BITRISEIO_ANDROID_QA_KEYSTORE_URL
- destination: android/keystores/internalRelease.keystore
- script@1:
title: Install CCache & symlink
inputs:
- content: |-
#!/usr/bin/env bash
sudo apt update
sudo apt install ccache -y
- restore-cache@2:
title: Restore CCache
inputs:
- key: '{{ getenv "CCACHE_KEY" }}'
- script@1:
title: Set skip ccache upload
run_if: '{{ enveq "BITRISE_CACHE_HIT" "exact" }}'
inputs:
- content: |-
#!/usr/bin/env bash
envman add --key SKIP_CCACHE_UPLOAD --value "true"
- script@1:
title: Run detox build
timeout: 1200
is_always_run: true
inputs:
- content: |-
#!/usr/bin/env bash
./scripts/cache/setup-ccache.sh
if [ "$TEST_SUITE" = "Regression" ]; then
TEST_SUITE="Regression"
else
TEST_SUITE="Smoke"
fi
node -v
export METAMASK_ENVIRONMENT='local'
export METAMASK_BUILD_TYPE='main'
IGNORE_BOXLOGS_DEVELOPMENT="true" yarn test:e2e:android:build:qa-release
- save-gradle-cache@1: {}
- save-cache@1:
title: Save CCache
run_if: '{{not (enveq "SKIP_CCACHE_UPLOAD" "true")}}'
inputs:
- key: '{{ getenv "CCACHE_KEY" }}'
- paths: |-
ccache
- deploy-to-bitrise-io@2.2.3:
inputs:
- pipeline_intermediate_files: android/app/build/outputs:INTERMEDIATE_ANDROID_BUILD_DIR
title: Save Android build
- save-cache@1:
title: Save node_modules
inputs:
- key: node_modules-{{ .OS }}-{{ .Arch }}-{{ getenv "BRANCH_COMMIT_HASH" }}
- paths: node_modules
meta:
bitrise.io:
machine_type_id: elite-xl
stack: linux-docker-android-22.04
android_e2e_test:
before_run:
- setup
- prep_environment
after_run:
- notify_failure
steps:
- restore-gradle-cache@2: {}
- pull-intermediate-files@1:
inputs:
- artifact_sources: .*
title: Pull Android build
- script@1:
title: Copy Android build for Detox
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
# Create directories for Detox
mkdir -p "$BITRISE_SOURCE_DIR/android/app/build/outputs"
# Copy saved files for Detox usage
# INTERMEDIATE_ANDROID_BUILD_DIR is the cached directory from android_e2e_build's "Save Android build" step
cp -r "$INTERMEDIATE_ANDROID_BUILD_DIR" "$BITRISE_SOURCE_DIR/android/app/build"
- restore-cache@2:
title: Restore cache node_modules
inputs:
- key: node_modules-{{ .OS }}-{{ .Arch }}-{{ getenv "BRANCH_COMMIT_HASH" }}
- avd-manager@1:
inputs:
- api_level: '34'
- abi: 'x86_64'
- create_command_flags: --sdcard 8192M
- start_command_flags: -read-only
- profile: pixel_5
- wait-for-android-emulator@1: {}
- script@1:
title: Run detox test
timeout: 1200
is_always_run: false
inputs:
- content: |-
#!/usr/bin/env bash
if [ -n "$TEST_SUITE_FOLDER" ]; then
echo "TEST_SUITE_FOLDER value is: $TEST_SUITE_FOLDER"
fi
if [ "$TEST_SUITE" = "Regression" ]; then
TEST_SUITE="Regression"
else
TEST_SUITE="Smoke"
fi
if [ -n "$TEST_SUITE_TAG" ]; then
echo "TEST_SUITE_TAG value is: $TEST_SUITE_TAG"
TEST_SUITE=$TEST_SUITE_TAG
fi
export METAMASK_ENVIRONMENT='local'
export METAMASK_BUILD_TYPE='main'
IGNORE_BOXLOGS_DEVELOPMENT="true" yarn test:e2e:android:run:qa-release "$TEST_SUITE_FOLDER" --testNamePattern="$TEST_SUITE"
- custom-test-results-export@1:
title: Export test results
is_always_run: true
is_skippable: true
inputs:
- base_path: $BITRISE_SOURCE_DIR/e2e/reports/
- test_name: E2E Tests
- search_pattern: $BITRISE_SOURCE_DIR/e2e/reports/junit.xml
- deploy-to-bitrise-io@2.2.3:
title: Deploy test report files
is_always_run: true
is_skippable: true
- script@1:
title: Copy screenshot files
is_always_run: true
run_if: .IsBuildFailed
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
cp -r "$BITRISE_SOURCE_DIR/artifacts" "$BITRISE_DEPLOY_DIR"
- deploy-to-bitrise-io@2.3:
title: Deploy test screenshots
is_always_run: true
run_if: .IsBuildFailed
inputs:
- deploy_path: $BITRISE_DEPLOY_DIR
- is_compress: true
- zip_name: E2E_Android_Failure_Artifacts
meta:
bitrise.io:
machine_type_id: elite-xl
stack: linux-docker-android-22.04
ios_api_specs:
before_run:
- setup
- install_applesimutils
- prep_environment
after_run:
- notify_failure
steps:
- pull-intermediate-files@1:
inputs:
- artifact_sources: .*
title: Pull iOS build
- script@1:
title: Copy iOS build for Detox
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
# Create directories for Detox
mkdir -p "$BITRISE_SOURCE_DIR/ios/build/Build"
mkdir -p "$BITRISE_SOURCE_DIR/../Library/Detox/ios"
# Copy saved files for Detox usage
# INTERMEDIATE_IOS_BUILD_DIR & INTERMEDIATE_IOS_DETOX_DIR are the cached directories by ios_e2e_build's "Save iOS build" step
cp -r "$INTERMEDIATE_IOS_BUILD_DIR" "$BITRISE_SOURCE_DIR/ios/build"
cp -r "$INTERMEDIATE_IOS_DETOX_DIR" "$BITRISE_SOURCE_DIR/../Library/Detox"
- restore-cocoapods-cache@2: {}
- restore-cache@2:
title: Restore cache node_modules
inputs:
- key: node_modules-{{ .OS }}-{{ .Arch }}-{{ getenv "BRANCH_COMMIT_HASH" }}
- certificate-and-profile-installer@1: {}
- set-xcode-build-number@1:
inputs:
- build_short_version_string: $VERSION_NAME
- plist_path: $PROJECT_LOCATION_IOS/MetaMask/Info.plist
- script:
inputs:
- content: |-
# Add cache directory to environment variable
envman add --key BREW_APPLESIMUTILS --value "$(brew --cellar)/applesimutils"
envman add --key BREW_OPT_APPLESIMUTILS --value "/usr/local/opt/applesimutils"
brew tap wix/brew
title: Set Env Path for caching deps
- script@1:
title: Run detox test
timeout: 1200
is_always_run: false
inputs:
- content: |-
#!/usr/bin/env bash
yarn test:api-specs --retries 1
- script@1:
is_always_run: true
is_skippable: false
title: Add tests reports to Bitrise
inputs:
- content: |-
#!/usr/bin/env bash
cp -r $BITRISE_SOURCE_DIR/html-report/index.html $BITRISE_HTML_REPORT_DIR/
- deploy-to-bitrise-io@2.2.3:
is_always_run: true
is_skippable: false
inputs:
- deploy_path: $BITRISE_HTML_REPORT_DIR
title: Deploy test report files
ios_e2e_build:
envs:
- NO_FLIPPER: '1'
before_run:
- install_applesimutils
- code_setup
- set_commit_hash
after_run:
- notify_failure
steps:
- script@1:
title: Generating ccache key using native folder checksum
inputs:
- content: |-
#!/usr/bin/env bash
./scripts/cache/set-cache-envs.sh ios
- certificate-and-profile-installer@1: {}
- set-xcode-build-number@1:
inputs:
- build_short_version_string: $VERSION_NAME
- plist_path: $PROJECT_LOCATION_IOS/MetaMask/Info.plist
- script:
inputs:
- content: |-
# Add cache directory to environment variable
envman add --key BREW_APPLESIMUTILS --value "$(brew --cellar)/applesimutils"
envman add --key BREW_OPT_APPLESIMUTILS --value "/usr/local/opt/applesimutils"
brew tap wix/brew
title: Set Env Path for caching deps
- script@1:
title: Install CCache & symlink
inputs:
- content: |-
#!/usr/bin/env bash
brew install ccache with HOMEBREW_NO_DEPENDENTS_CHECK=1
ln -s $(which ccache) /usr/local/bin/gcc
ln -s $(which ccache) /usr/local/bin/g++
ln -s $(which ccache) /usr/local/bin/cc
ln -s $(which ccache) /usr/local/bin/c++
ln -s $(which ccache) /usr/local/bin/clang
ln -s $(which ccache) /usr/local/bin/clang++
- restore-cache@2:
title: Restore CCache
inputs:
- key: '{{ getenv "CCACHE_KEY" }}'
- script@1:
title: Set skip ccache upload
run_if: '{{ enveq "BITRISE_CACHE_HIT" "exact" }}'
inputs:
- content: |-
#!/usr/bin/env bash
envman add --key SKIP_CCACHE_UPLOAD --value "true"
- script@1:
title: Run detox build
timeout: 1200
is_always_run: true
inputs:
- content: |-
#!/usr/bin/env bash
./scripts/cache/setup-ccache.sh
if [ "$TEST_SUITE" = "Regression" ]; then
TEST_SUITE="Regression"
else
TEST_SUITE="Smoke"
fi
node -v
export METAMASK_ENVIRONMENT='local'
export METAMASK_BUILD_TYPE='main'
IGNORE_BOXLOGS_DEVELOPMENT="true" yarn test:e2e:ios:build:qa-release
- save-cocoapods-cache@1: {}
- save-cache@1:
title: Save CCache
run_if: '{{not (enveq "SKIP_CCACHE_UPLOAD" "true")}}'
inputs:
- key: '{{ getenv "CCACHE_KEY" }}'
- paths: |-
ccache
- deploy-to-bitrise-io@2.2.3:
inputs:
- pipeline_intermediate_files: |-
ios/build/Build:INTERMEDIATE_IOS_BUILD_DIR
../Library/Detox/ios:INTERMEDIATE_IOS_DETOX_DIR
title: Save iOS build
- save-cache@1:
title: Save node_modules
inputs:
- key: node_modules-{{ .OS }}-{{ .Arch }}-{{ getenv "BRANCH_COMMIT_HASH" }}
- paths: node_modules
ios_e2e_test:
envs:
- NO_FLIPPER: '1'
before_run:
- setup
- install_applesimutils
- prep_environment
after_run:
- notify_failure
steps:
- pull-intermediate-files@1:
inputs:
- artifact_sources: .*
title: Pull iOS build
- script@1:
title: Copy iOS build for Detox
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
# Create directories for Detox
mkdir -p "$BITRISE_SOURCE_DIR/ios/build/Build"
mkdir -p "$BITRISE_SOURCE_DIR/../Library/Detox/ios"
# Copy saved files for Detox usage
# INTERMEDIATE_IOS_BUILD_DIR & INTERMEDIATE_IOS_DETOX_DIR are the cached directories by ios_e2e_build's "Save iOS build" step
cp -r "$INTERMEDIATE_IOS_BUILD_DIR" "$BITRISE_SOURCE_DIR/ios/build"
cp -r "$INTERMEDIATE_IOS_DETOX_DIR" "$BITRISE_SOURCE_DIR/../Library/Detox"
- restore-cocoapods-cache@2: {}
- restore-cache@2:
title: Restore cache node_modules
inputs:
- key: node_modules-{{ .OS }}-{{ .Arch }}-{{ getenv "BRANCH_COMMIT_HASH" }}
- certificate-and-profile-installer@1: {}
- set-xcode-build-number@1:
inputs:
- build_short_version_string: $VERSION_NAME
- plist_path: $PROJECT_LOCATION_IOS/MetaMask/MetaMask-QA-Info.plist
- script:
inputs:
- content: |-
# Add cache directory to environment variable
envman add --key BREW_APPLESIMUTILS --value "$(brew --cellar)/applesimutils"
envman add --key BREW_OPT_APPLESIMUTILS --value "/usr/local/opt/applesimutils"
brew tap wix/brew
title: Set Env Path for caching deps
- script@1:
title: Run detox test
timeout: 1200
is_always_run: false
inputs:
- content: |-