-
Notifications
You must be signed in to change notification settings - Fork 822
/
Copy pathconfig.base.yml
1322 lines (1283 loc) · 43.6 KB
/
config.base.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
version: 2.1
orbs:
aws-ecr: circleci/[email protected]
machine:
environment:
PATH: '${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin'
parameters:
nightly_console_integration_tests:
type: boolean
default: false
setup:
type: boolean
default: true
executors:
w_medium: &windows-e2e-executor-medium
machine:
image: 'windows-server-2019-vs2019:stable'
resource_class: 'windows.medium'
shell: bash.exe
working_directory: ~/repo
environment:
AMPLIFY_DIR: C:/home/circleci/repo/out
AMPLIFY_PATH: C:/home/circleci/repo/out/amplify.exe
w_xlarge: &windows-e2e-executor-xlarge
machine:
image: 'windows-server-2019-vs2019:stable'
resource_class: 'windows.xlarge'
shell: bash.exe
working_directory: ~/repo
environment:
AMPLIFY_DIR: C:/home/circleci/repo/out
AMPLIFY_PATH: C:/home/circleci/repo/out/amplify.exe
l_xlarge: &linux-e2e-executor-xlarge
docker:
- image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:latest
working_directory: ~/repo
resource_class: xlarge
environment:
AMPLIFY_DIR: /home/circleci/repo/out
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
# If you update this name, make sure to update it in split-e2e-tests.ts as well
l_large: &linux-e2e-executor-large
docker:
- image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:latest
working_directory: ~/repo
resource_class: large
environment:
AMPLIFY_DIR: /home/circleci/repo/out
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
# If you update this name, make sure to update it in split-e2e-tests.ts as well
l_medium: &linux-e2e-executor-medium
docker:
- image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:latest
working_directory: ~/repo
resource_class: medium
environment:
AMPLIFY_DIR: /home/circleci/repo/out
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
defaults: &defaults
working_directory: ~/repo
parameters:
os:
type: executor
default: l_medium
executor: << parameters.os >>
scan_e2e_test_artifacts: &scan_e2e_test_artifacts
name: Scan And Cleanup E2E Test Artifacts
no_output_timeout: 90m
command: |
if ! yarn ts-node .circleci/scan_artifacts.ts; then
echo "Cleaning the repository"
git clean -fdx
exit 1
fi
when: always
install_cli_from_local_registry: &install_cli_from_local_registry
name: Start verdaccio, install node CLI and amplify-app
command: |
source .circleci/local_publish_helpers.sh
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
setNpmRegistryUrlToLocal
changeNpmGlobalPath
npm install -g @aws-amplify/cli
npm install -g amplify-app
unsetNpmRegistryUrl
jobs:
build:
parameters:
os:
type: executor
default: l_xlarge
executor: l_xlarge
steps:
- checkout
- run: yarn config set script-shell $(which bash)
- run: yarn run production-build
- run:
name: Build tests
command: yarn build-tests
- save_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
paths:
- ~/repo
- save_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache
- save_cache:
key: amplify-cli-ssh-deps-{{ .Branch }}
paths:
- ~/.ssh
build_windows_workspace_for_e2e:
parameters:
os:
type: executor
default: w_xlarge
executor: w_xlarge
steps:
- when:
condition:
equal: [*windows-e2e-executor-xlarge, << parameters.os >>]
steps:
- checkout
- run: yarn config set script-shell $(which bash)
- run: yarn run production-build
- run:
name: Build tests
command: yarn build-tests
- persist_to_workspace:
root: ~/.
paths:
- repo
- .cache
- .ssh
test:
<<: *linux-e2e-executor-xlarge
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: Run tests
command: yarn test-ci
- run:
name: Collect code coverage
command: yarn coverage
environment:
NODE_OPTIONS: --max-old-space-size=4096
lint:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run: yarn eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 1085
- run: yarn eslint --no-eslintrc --config .eslint.package.json.js "**/package.json"
- run: yarn prettier --check .
verify-api-extract:
<<: *linux-e2e-executor-xlarge
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: extract api
command: |
yarn verify-api-extract
verify-yarn-lock:
<<: *linux-e2e-executor-medium
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: verify yarn lock
command: |
yarn verify-yarn-lock
verify-versions-match:
<<: *linux-e2e-executor-medium
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- restore_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- run:
name: verify versions match
command: |
source .circleci/local_publish_helpers.sh
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
setNpmRegistryUrlToLocal
changeNpmGlobalPath
checkPackageVersionsInLocalNpmRegistry
mock_e2e_tests:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: Run Transformer end-to-end tests with mock server
command: |
source .circleci/local_publish_helpers.sh
cd packages/amplify-util-mock/
yarn e2e
no_output_timeout: 90m
environment:
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
- store_test_results:
path: ~/repo/packages/amplify-util-mock/
publish_to_local_registry:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: Publish to verdaccio
command: |
source .circleci/local_publish_helpers.sh
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
setNpmRegistryUrlToLocal
export LOCAL_PUBLISH_TO_LATEST=true
./.circleci/publish.sh
unsetNpmRegistryUrl
- run:
name: Generate unified changelog
command: |
git reset --soft HEAD~1
yarn ts-node scripts/unified-changelog.ts
cat UNIFIED_CHANGELOG.md
- run:
name: Save new amplify GitHub tag
command: node scripts/echo-current-cli-version.js > .amplify-pkg-version
- save_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
paths:
- ~/verdaccio-cache/
- save_cache:
key: amplify-unified-changelog-{{ .Branch }}-{{ .Revision }}
paths:
- ~/repo/UNIFIED_CHANGELOG.md
- save_cache:
key: amplfiy-pkg-tag-{{ .Branch }}-{{ .Revision }}
paths:
- ~/repo/.amplify-pkg-version
upload_pkg_binaries:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-linux-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-macos-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-win-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-arm-{{ .Branch }}-{{ .Revision }}
- run:
name: Consolidate binaries cache and upload
command: |
source .circleci/local_publish_helpers.sh
uploadPkgCli
- save_cache:
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
paths:
- ~/repo/out
build_pkg_binaries_linux:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- restore_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- run:
name: Start verdaccio and package CLI
command: |
source .circleci/local_publish_helpers.sh
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
setNpmRegistryUrlToLocal
changeNpmGlobalPath
generatePkgCli linux
unsetNpmRegistryUrl
- save_cache:
key: amplify-pkg-binaries-linux-{{ .Branch }}-{{ .Revision }}
paths:
- ~/repo/out
build_pkg_binaries_macos:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- restore_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- run:
name: Start verdaccio and package CLI
command: |
source .circleci/local_publish_helpers.sh
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
setNpmRegistryUrlToLocal
changeNpmGlobalPath
generatePkgCli macos
unsetNpmRegistryUrl
- save_cache:
key: amplify-pkg-binaries-macos-{{ .Branch }}-{{ .Revision }}
paths:
- ~/repo/out
build_pkg_binaries_win:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- restore_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- run:
name: Start verdaccio and package CLI
command: |
source .circleci/local_publish_helpers.sh
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
setNpmRegistryUrlToLocal
changeNpmGlobalPath
generatePkgCli win
unsetNpmRegistryUrl
- save_cache:
key: amplify-pkg-binaries-win-{{ .Branch }}-{{ .Revision }}
paths:
- ~/repo/out
build_pkg_binaries_arm:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- restore_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- run:
name: Start verdaccio and package CLI
command: |
source .circleci/local_publish_helpers.sh
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
setNpmRegistryUrlToLocal
changeNpmGlobalPath
generatePkgCli arm
unsetNpmRegistryUrl
- save_cache:
key: amplify-pkg-binaries-arm-{{ .Branch }}-{{ .Revision }}
paths:
- ~/repo/out
verify_pkg_binaries:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-linux-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-macos-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-win-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-arm-{{ .Branch }}-{{ .Revision }}
- run:
name: Verify packaged CLI
command: |
source .circleci/local_publish_helpers.sh
verifyPkgCli
amplify_sudo_install_test:
<<: *defaults
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- run:
name: Update OS Packages
command: sudo apt-get update
- run:
name: Start verdaccio and Install Amplify CLI as sudo
command: |
source .circleci/local_publish_helpers.sh
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
setSudoNpmRegistryUrlToLocal
changeSudoNpmGlobalPath
sudo npm install -g @aws-amplify/cli
unsetSudoNpmRegistryUrl
amplify version
amplify_e2e_tests_pkg:
parameters:
os:
type: executor
default: l_medium
executor: << parameters.os >>
working_directory: ~/repo
steps:
- when:
condition:
equal: [*windows-e2e-executor-medium, << parameters.os >>]
steps:
- attach_workspace:
at: ~/.
- when:
condition:
or:
- equal: [*linux-e2e-executor-large, << parameters.os >>]
- equal: [*linux-e2e-executor-medium, << parameters.os >>]
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- restore_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-build-artifact-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- rename_binary_for_windows:
os: << parameters.os >>
- install_packaged_cli:
os: << parameters.os >>
- run_e2e_tests:
os: << parameters.os >>
- scan_e2e_test_artifacts:
os: << parameters.os >>
- store_test_results:
path: ~/repo/packages/amplify-e2e-tests/
- store_artifacts:
path: ~/repo/packages/amplify-e2e-tests/amplify-e2e-reports
amplify_migration_tests_v5:
parameters:
os:
type: executor
default: l_large
executor: << parameters.os >>
environment:
AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli/bin/amplify
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- restore_cache:
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- run:
name: Run tests migrating from CLI v5.2.0
command: |
source .circleci/local_publish_helpers.sh
changeNpmGlobalPath
cd packages/amplify-migration-tests
retry yarn run migration_v5.2.0 --no-cache --maxWorkers=3 --forceExit $TEST_SUITE
no_output_timeout: 65m
- run: *scan_e2e_test_artifacts
- store_test_results:
path: ~/repo/packages/amplify-migration-tests/
- store_artifacts:
path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
working_directory: ~/repo
amplify_migration_tests_v6:
parameters:
os:
type: executor
default: l_large
executor: << parameters.os >>
environment:
AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli/bin/amplify
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- restore_cache:
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- run:
name: Run tests migrating from CLI v6.1.0
command: |
source .circleci/local_publish_helpers.sh
changeNpmGlobalPath
cd packages/amplify-migration-tests
retry yarn run migration_v6.1.0 --no-cache --maxWorkers=3 --forceExit $TEST_SUITE
no_output_timeout: 65m
- run: *scan_e2e_test_artifacts
- store_test_results:
path: ~/repo/packages/amplify-migration-tests/
- store_artifacts:
path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
working_directory: ~/repo
amplify_migration_tests_v10:
parameters:
os:
type: executor
default: l_large
executor: << parameters.os >>
environment:
AMPLIFY_PATH: /home/circleci/.amplify/bin/amplify
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- restore_cache:
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- run:
name: Run tests migrating from CLI v10.5.1
command: |
source .circleci/local_publish_helpers.sh
changeNpmGlobalPath
cd packages/amplify-migration-tests
unset IS_AMPLIFY_CI
echo $IS_AMPLIFY_CI
retry yarn run migration_v10.5.1 --no-cache --maxWorkers=3 --forceExit $TEST_SUITE
no_output_timeout: 65m
- run: *scan_e2e_test_artifacts
- store_test_results:
path: ~/repo/packages/amplify-migration-tests/
- store_artifacts:
path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
working_directory: ~/repo
amplify_migration_tests_non_multi_env_layers:
parameters:
os:
type: executor
default: l_large
executor: << parameters.os >>
environment:
AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli/bin/amplify
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: Run tests migrating from CLI v4.28.2
command: |
source .circleci/local_publish_helpers.sh
changeNpmGlobalPath
cd packages/amplify-migration-tests
retry yarn run migration_v4.28.2_nonmultienv_layers --no-cache --maxWorkers=3 --forceExit $TEST_SUITE
no_output_timeout: 90m
- run: *scan_e2e_test_artifacts
- store_test_results:
path: ~/repo/packages/amplify-migration-tests/
- store_artifacts:
path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
working_directory: ~/repo
amplify_migration_tests_multi_env_layers:
parameters:
os:
type: executor
default: l_large
executor: << parameters.os >>
environment:
AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli/bin/amplify
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- restore_cache:
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- run:
name: Run tests migrating from CLI v4.52.0
command: |
source .circleci/local_publish_helpers.sh
changeNpmGlobalPath
cd packages/amplify-migration-tests
retry yarn run migration_v4.52.0_multienv_layers --no-cache --maxWorkers=3 --forceExit $TEST_SUITE
no_output_timeout: 90m
- run: *scan_e2e_test_artifacts
- store_test_results:
path: ~/repo/packages/amplify-migration-tests/
- store_artifacts:
path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
working_directory: ~/repo
amplify_console_integration_tests:
parameters:
os:
type: executor
default: l_large
executor: << parameters.os >>
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- run: *install_cli_from_local_registry
- run:
command: |
echo "export PATH=~/.npm-global/bin:$PATH" >> $BASH_ENV
source $BASH_ENV
source .circleci/local_publish_helpers.sh
amplify -v
cd packages/amplify-console-integration-tests
retry yarn run console-integration --no-cache --maxWorkers=3
name: 'Run Amplify Console integration tests'
no_output_timeout: 90m
- run: *scan_e2e_test_artifacts
- store_test_results:
path: ~/repo/packages/amplify-console-integration-tests/
- store_artifacts:
path: ~/repo/packages/amplify-console-integration-tests/console-integration-reports
working_directory: ~/repo
integration_test:
working_directory: /home/circleci/repo
resource_class: large
docker:
- image: cypress/base:14.17.0
environment:
TERM: dumb
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- run: cd .circleci/ && chmod +x aws.sh
- run:
name: Setup Dependencies
command: |
apt-get update
apt-get install -y sudo
sudo apt-get install -y tcl
sudo apt-get install -y expect
sudo apt-get install -y zip
sudo apt-get install -y lsof
sudo apt-get install -y python python-pip libpython-dev
sudo apt-get install -y jq
pip install awscli
- run: expect .circleci/aws_configure.exp
- run:
name: Configure Amplify CLI
command: |
yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev
echo 'export PATH="$(yarn global bin):$PATH"' >> $BASH_ENV
amplify-dev
- run:
name: Clone auth test package
command: |
cd ..
git clone $AUTH_CLONE_URL
cd aws-amplify-cypress-auth
yarn --cache-folder ~/.cache/yarn
yarn add [email protected] --save
- run: cd .circleci/ && chmod +x auth.sh
- run: cd .circleci/ && chmod +x amplify_init.sh
- run: cd .circleci/ && chmod +x amplify_init.exp
- run: expect .circleci/amplify_init.exp ../aws-amplify-cypress-auth
- run: expect .circleci/enable_auth.exp
- run: cd ../aws-amplify-cypress-auth
- run: yarn --frozen-lockfile --cache-folder ~/.cache/yarn
- run: cd ../aws-amplify-cypress-auth/src && cat $(find . -type f -name 'aws-exports*')
- run:
name: Start Auth test server in background
command: |
cd ../aws-amplify-cypress-auth
pwd
yarn start
background: true
- run: cat $(find ../repo -type f -name 'auth_spec*')
- run:
name: Run cypress tests for auth
command: |
cd ../aws-amplify-cypress-auth
cp ../repo/cypress.json .
cp -R ../repo/cypress .
yarn cypress run --spec $(find . -type f -name 'auth_spec*')
- run: sudo kill -9 $(lsof -t -i:3000)
- run: cd .circleci/ && chmod +x delete_auth.sh
- run: expect .circleci/delete_auth.exp
- run:
name: Clone API test package
command: |
cd ..
git clone $API_CLONE_URL
cd aws-amplify-cypress-api
yarn --cache-folder ~/.cache/yarn
- run: cd .circleci/ && chmod +x api.sh
- run: expect .circleci/amplify_init.exp ../aws-amplify-cypress-api
- run: expect .circleci/enable_api.exp
- run: cd ../aws-amplify-cypress-api
- run: yarn --frozen-lockfile --cache-folder ~/.cache/yarn
- run: cd ../aws-amplify-cypress-api/src && cat $(find . -type f -name 'aws-exports*')
- run:
name: Start API test server in background
command: |
cd ../aws-amplify-cypress-api
pwd
yarn start
background: true
- run:
name: Run cypress tests for api
command: |
cd ../aws-amplify-cypress-api
yarn add [email protected] --save
cp ../repo/cypress.json .
cp -R ../repo/cypress .
yarn cypress run --spec $(find . -type f -name 'api_spec*')
- run: cd .circleci/ && chmod +x delete_api.sh
- run: expect .circleci/delete_api.exp
- run: *scan_e2e_test_artifacts
- store_artifacts:
path: ~/aws-amplify-cypress-auth/cypress/videos
- store_artifacts:
path: ~/aws-amplify-cypress-auth/cypress/screenshots
- store_artifacts:
path: ~/aws-amplify-cypress-api/cypress/videos
- store_artifacts:
path: ~/aws-amplify-cypress-api/cypress/screenshots
deploy:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
keys:
- amplify-cli-ssh-deps-{{ .Branch }}
- restore_cache:
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- run:
name: Upload Pkg Binary
command: |
source .circleci/local_publish_helpers.sh
uploadPkgCli
./out/amplify-pkg-linux-x64 --version
- run:
name: Authenticate with npm
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- run:
name: Publish Amplify CLI
command: |
bash ./.circleci/publish.sh
- run: *scan_e2e_test_artifacts
github_prerelease:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-unified-changelog-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplfiy-pkg-tag-{{ .Branch }}-{{ .Revision }}
- run:
name: Compress binaries
command: |
cd out
mv amplify-pkg-macos-x64 amplify-pkg-macos
mv amplify-pkg-linux-x64 amplify-pkg-linux
mv amplify-pkg-win-x64.exe amplify-pkg-win.exe
tar zcvf amplify-pkg-macos.tgz amplify-pkg-macos
tar zcvf amplify-pkg-linux.tgz amplify-pkg-linux
tar zcvf amplify-pkg-win.exe.tgz amplify-pkg-win.exe
- run:
name: Publish Amplify CLI GitHub prerelease
command: |
commit=$(git rev-parse HEAD)
version=$(cat .amplify-pkg-version)
yarn ts-node scripts/github-prerelease.ts $version $commit
github_prerelease_install_sanity_check:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplfiy-pkg-tag-{{ .Branch }}-{{ .Revision }}
- run:
name: Install packaged Amplify CLI
command: |
version=$(cat .amplify-pkg-version)
curl -sL https://aws-amplify.github.io/amplify-cli/install | version=v$version bash
echo "export PATH=$PATH:$HOME/.amplify/bin" >> $BASH_ENV
- run:
name: Sanity check install
command: |
amplify version
github_release:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplfiy-pkg-tag-{{ .Branch }}-{{ .Revision }}
- run:
name: Publish Amplify CLI GitHub release
command: |
commit=$(git rev-parse HEAD)
version=$(cat .amplify-pkg-version)
yarn ts-node scripts/github-release.ts $version $commit
cleanup_resources:
<<: *linux-e2e-executor-large
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: 'Run cleanup script'
command: |
cd packages/amplify-e2e-tests
yarn clean-e2e-resources
no_output_timeout: 90m
- run: *scan_e2e_test_artifacts
- store_artifacts:
path: ~/repo/packages/amplify-e2e-tests/amplify-e2e-reports
working_directory: ~/repo
trigger_e2e_workflow_cleanup:
<<: *linux-e2e-executor-medium
steps:
- run:
name: 'Trigger Cleanup for this Workflow'
command: |
echo "Triggering cleanup for Workflow $CIRCLE_WORKFLOW_ID"
curl --request POST \
--url https://circleci.com/api/v2/project/gh/aws-amplify/amplify-cli/pipeline \
--header "Circle-Token: $AMPLIFY_CLI_CIRCLECI_TRIGGER_TOKEN" \
--header "content-type: application/json" \
--data '{"branch":"'$CIRCLE_BRANCH'","parameters":{"e2e_workflow_cleanup":true,"setup":false,"e2e_workflow_cleanup_workflow_id":"'$CIRCLE_WORKFLOW_ID'"}}'
wait_for_all:
<<: *linux-e2e-executor-medium
steps:
- restore_cache:
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- restore_cache:
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: 'Wait for all required jobs to finish'
command: |
while [[ $(curl --location --request GET "https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/job" --header "Circle-Token: $CIRCLECI_TOKEN"| jq -r '.items[]|select(.name != "wait_for_all")|.status' | grep -c "running") -gt 0 ]]
do
sleep 60
done
no_output_timeout: 180m
- run:
name: 'Collect Results'
command: yarn workflow-results
- run: *scan_e2e_test_artifacts
- store_artifacts:
path: ~/repo/artifacts
working_directory: ~/repo
workflows:
version: 3
build_test_deploy_v3:
jobs:
- build:
filters:
branches:
ignore:
- beta
- build_windows_workspace_for_e2e:
filters:
branches:
only:
- dev
- /run-e2e-with-rc\/.*/
- /tagged-release\/.*/
- /run-e2e\/.*/
- lint:
requires:
- build
filters:
branches:
ignore:
- beta
- release
- /release_rc\/.*/
- /tagged-release-without-e2e-tests\/.*/
- /run-e2e\/.*/
- verify-api-extract:
requires:
- build
filters:
branches:
ignore:
- beta
- release
- /release_rc\/.*/
- /tagged-release-without-e2e-tests\/.*/
- verify-yarn-lock:
requires:
- build
- verify-versions-match:
requires:
- publish_to_local_registry
- test:
requires:
- build
filters:
branches:
ignore:
- beta
- release
- /release_rc\/.*/
- /tagged-release-without-e2e-tests\/.*/
- mock_e2e_tests:
requires:
- build
filters:
branches:
ignore:
- beta
- release
- /tagged-release-without-e2e-tests\/.*/
- integration_test:
context:
- e2e-test-context
filters:
branches:
only:
- dev
- /run-e2e-with-rc\/.*/
- /tagged-release\/.*/
- /run-e2e\/.*/
requires:
- build
- publish_to_local_registry:
requires:
- build
- upload_pkg_binaries:
filters:
branches:
only:
- dev
- release
- /release_rc\/.*/
- /run-e2e-with-rc\/.*/
- /tagged-release\/.*/
- /tagged-release-without-e2e-tests\/.*/
- /run-e2e\/.*/
context:
- e2e-auth-credentials
- e2e-test-context
- amplify-s3-upload
requires:
- build_pkg_binaries_linux
- build_pkg_binaries_macos
- build_pkg_binaries_win
- build_pkg_binaries_arm
- build_pkg_binaries_linux:
requires:
- publish_to_local_registry
- build_pkg_binaries_macos:
requires:
- publish_to_local_registry
- build_pkg_binaries_win:
requires:
- publish_to_local_registry