forked from aws-amplify/amplify-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
660 lines (637 loc) · 22.5 KB
/
config.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
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2.1
machine:
environment:
PATH: '${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin'
defaults: &defaults
docker:
- image: cypress/base:10
environment:
## this enables colors in the output
TERM: xterm
defaults_rn: &defaults_rn
macos:
xcode: '11.3.1'
working_directory: ~/amplify-js-samples-staging
commands:
restore_pods:
steps:
- restore_cache:
keys:
- v1-storage-app-pods-{{ checksum "ios/Podfile.lock" }}
- v1-storage-app-pods-
save_pods:
steps:
- save_cache:
key: v1-storage-app-pods-{{ checksum "ios/Podfile.lock" }}
paths:
- ios/Pods
jobs:
build:
<<: *defaults
working_directory: ~/amplify-js
resource_class: large
steps:
- checkout
- run: yarn config set workspaces-experimental true
- run: yarn --frozen-lockfile
- run: yarn run bootstrap
- run: yarn run build
- save_cache:
key: amplify-ssh-deps-{{ .Branch }}
paths:
- ~/.ssh
- persist_to_workspace:
root: /root
paths: amplify-js
unit_test:
<<: *defaults
working_directory: ~/amplify-js
steps:
- attach_workspace:
at: /root
- run:
name: 'Run Amplify JS unit tests'
command: |
yarn run test --scope @aws-amplify/auth
yarn run test --scope @aws-amplify/api
yarn run test --scope @aws-amplify/analytics
yarn run test --scope @aws-amplify/cache
yarn run test --scope @aws-amplify/core
yarn run test --scope @aws-amplify/datastore
yarn run test --scope @aws-amplify/interactions
yarn run test --scope @aws-amplify/pubsub
yarn run test --scope @aws-amplify/predictions
yarn run test --scope @aws-amplify/storage
yarn run test --scope @aws-amplify/xr
yarn run test --scope amazon-cognito-identity-js
yarn run test --scope aws-amplify-react
yarn run test --scope aws-amplify-angular
yarn run test --scope aws-amplify-vue
yarn run coverage
integ_setup:
<<: *defaults
working_directory: ~/
steps:
- run:
name: 'Clone Amplify JS Samples repo, install cypress, install react samples authenticator and link amplify packages'
command: |
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
echo $SSH_HOST_PUBLIC_KEY >> ~/.ssh/known_hosts
git clone $AMPLIFY_JS_SAMPLES_STAGING_URL
cd amplify-js-samples-staging
yarn
- save_cache:
key: amplify-js-{{ .Branch }}-{{ checksum "amplify-js-samples-staging/yarn.lock" }}
paths:
- ~/.cache ## cache both yarn and Cypress
- persist_to_workspace:
root: /root
paths: amplify-js-samples-staging
integ_react_predictions:
<<: *defaults
working_directory: ~/
steps:
- attach_workspace:
at: /root
- restore_cache:
key: amplify-js-{{ .Branch }}-{{ checksum "amplify-js-samples-staging/yarn.lock" }}
- run:
name: 'Link aws-amplify'
command: |
cd amplify-js/packages/aws-amplify
yarn link
- run:
name: 'Link predictions'
command: |
cd amplify-js/packages/predictions
yarn link
- run:
name: 'Install Predictions React sample'
command: |
cd amplify-js-samples-staging/samples/react/predictions/multi-user-translation
yarn
yarn link aws-amplify
yarn link @aws-amplify/predictions
- run:
name: 'Start Predictions React Sample server in background'
command: |
cd amplify-js-samples-staging/samples/react/predictions/multi-user-translation
yarn start
background: true
- run:
name: 'Run cypress tests for Predictions React Sample'
command: |
cd amplify-js-samples-staging
yarn cypress:react --spec "cypress/integration/predictions/multiuser-translation.spec.js"
- store_artifacts:
path: amplify-js-samples-staging/cypress/videos
- store_artifacts:
path: amplify-js-samples-staging/cypress/screenshots
integ_react_auth:
<<: *defaults
working_directory: ~/
steps:
- attach_workspace:
at: /root
- restore_cache:
key: amplify-js-{{ .Branch }}-{{ checksum "amplify-js-samples-staging/yarn.lock" }}
- run:
name: 'Install React Authenticator sample'
command: |
cd amplify-js-samples-staging/samples/react/auth/with-authenticator
yarn
- run:
name: 'Link aws-amplify'
command: |
cd amplify-js/packages/aws-amplify
yarn link
- run:
name: 'Link aws-amplify-react'
command: |
cd amplify-js/packages/aws-amplify-react
yarn link
- run:
name: 'Install React Authenticator sample'
command: |
cd amplify-js-samples-staging/samples/react/auth/with-authenticator
yarn
yarn link aws-amplify
yarn link aws-amplify-react
- run:
name: 'Start React Authenticator Sample server in background'
command: |
cd amplify-js-samples-staging/samples/react/auth/with-authenticator
yarn start
background: true
- run:
name: 'Run cypress tests for React Authenticator Sample'
command: |
cd amplify-js-samples-staging
yarn cypress:react --spec "cypress/integration/auth/authenticator.spec.js"
- store_artifacts:
path: amplify-js-samples-staging/cypress/videos
- store_artifacts:
path: amplify-js-samples-staging/cypress/screenshots
integ_angular_auth:
<<: *defaults
working_directory: ~/
steps:
- attach_workspace:
at: /root
- restore_cache:
key: amplify-js-{{ .Branch }}-{{ checksum "amplify-js-samples-staging/yarn.lock" }}
- run:
name: 'Install Angular Authenticator sample'
command: |
cd amplify-js-samples-staging/samples/angular/auth/amplify-authenticator
yarn
- run:
name: 'Link aws-amplify'
command: |
cd amplify-js/packages/aws-amplify
yarn link
- run:
name: 'Link aws-amplify-angular'
command: |
cd amplify-js/packages/aws-amplify-angular
yarn link
- run:
name: 'Link @aws-amplify/analytics'
command: |
cd amplify-js/packages/analytics
yarn link
- run:
name: 'Install Angular Authenticator sample'
command: |
cd amplify-js-samples-staging/samples/angular/auth/amplify-authenticator
yarn
yarn link aws-amplify
yarn link aws-amplify-angular
yarn link @aws-amplify/analytics
- run:
name: 'Start Angular Authenticator Sample server in background'
command: |
cd amplify-js-samples-staging/samples/angular/auth/amplify-authenticator
yarn start
background: true
- run:
name: 'Run cypress tests for Angular Authenticator Sample'
command: |
cd amplify-js-samples-staging
yarn cypress:angular --spec "cypress/integration/auth/authenticator.spec.js"
- store_artifacts:
path: amplify-js-samples-staging/cypress/videos
- store_artifacts:
path: amplify-js-samples-staging/cypress/screenshots
integ_vue_auth:
<<: *defaults
working_directory: ~/
steps:
- attach_workspace:
at: /root
- restore_cache:
key: amplify-js-{{ .Branch }}-{{ checksum "amplify-js-samples-staging/yarn.lock" }}
- run:
name: 'Install Vue Authenticator sample'
command: |
cd amplify-js-samples-staging/samples/vue/auth/amplify-authenticator
yarn
- run:
name: 'Link aws-amplify'
command: |
cd amplify-js/packages/aws-amplify
yarn link
- run:
name: 'Link aws-amplify-vue'
command: |
cd amplify-js/packages/aws-amplify-vue
yarn link
- run:
name: 'Start Vue Authenticator Sample server in background'
command: |
cd amplify-js-samples-staging/samples/vue/auth/amplify-authenticator
yarn start
background: true
- run:
name: 'Run cypress tests for Vue Authenticator Sample'
command: |
cd amplify-js-samples-staging
yarn cypress:vue --spec "cypress/integration/auth/authenticator.spec.js"
- store_artifacts:
path: amplify-js-samples-staging/cypress/videos
- store_artifacts:
path: amplify-js-samples-staging/cypress/screenshots
integ_setup_ui:
<<: *defaults
working_directory: ~/
steps:
- run:
name: 'Clone Amplify JS Samples repo, install cypress, install react samples authenticator and link amplify packages'
command: |
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
echo $SSH_HOST_PUBLIC_KEY >> ~/.ssh/known_hosts
git clone $AMPLIFY_JS_SAMPLES_STAGING_URL amplify-js-samples-staging-ui
cd amplify-js-samples-staging-ui
git checkout ui-components/master
yarn
- save_cache:
key: amplify-js-ui
paths:
- ~/.cache ## cache both yarn and Cypress
- persist_to_workspace:
root: /root
paths: amplify-js-samples-staging-ui
integ_react_auth_ui:
<<: *defaults
working_directory: ~/
steps:
- attach_workspace:
at: /root
- restore_cache:
key: amplify-js-ui
- run:
name: 'Install React Authenticator sample'
command: |
cd amplify-js-samples-staging-ui/samples/react/auth/amplify-authenticator
yarn
- run:
name: 'Link aws-amplify'
command: |
cd amplify-js/packages/aws-amplify
yarn link
- run:
name: 'Link amplify-ui-react'
command: |
cd amplify-js/packages/amplify-ui-react
yarn link
- run:
name: 'Install React Authenticator sample'
command: |
cd amplify-js-samples-staging-ui/samples/react/auth/amplify-authenticator
yarn
yarn link aws-amplify
yarn link @aws-amplify/ui-react
- run:
name: 'Start React Authenticator UI Sample server in background'
command: |
cd amplify-js-samples-staging-ui
yarn ci:test react auth amplify-authenticator
- store_artifacts:
path: amplify-js-samples-staging-ui/cypress/videos
- store_artifacts:
path: amplify-js-samples-staging-ui/cypress/screenshots
integ_angular_auth_ui:
<<: *defaults
working_directory: ~/
steps:
- attach_workspace:
at: /root
- restore_cache:
key: amplify-js-ui
- run:
name: 'Install React Authenticator sample'
command: |
cd amplify-js-samples-staging-ui/samples/angular/auth/amplify-authenticator
yarn
- run:
name: 'Link aws-amplify'
command: |
cd amplify-js/packages/aws-amplify
yarn link
- run:
name: 'Link amplify-ui-angular'
command: |
cd amplify-js/packages/amplify-ui-angular
yarn link
- run:
name: 'Install Angular Authenticator sample'
command: |
cd amplify-js-samples-staging-ui/samples/angular/auth/amplify-authenticator
yarn
yarn link aws-amplify
yarn link @aws-amplify/ui-angular
- run:
name: 'Start Angular Authenticator UI Sample server in background'
command: |
cd amplify-js-samples-staging-ui
yarn ci:test angular auth amplify-authenticator
- store_artifacts:
path: amplify-js-samples-staging-ui/cypress/videos
- store_artifacts:
path: amplify-js-samples-staging-ui/cypress/screenshots
integ_vue_auth_ui:
<<: *defaults
working_directory: ~/
steps:
- attach_workspace:
at: /root
- restore_cache:
key: amplify-js-ui
- run:
name: 'Install Vue Authenticator sample'
command: |
cd amplify-js-samples-staging-ui/samples/vue/auth/amplify-authenticator
yarn
- run:
name: 'Link aws-amplify'
command: |
cd amplify-js/packages/aws-amplify
yarn link
- run:
name: 'Link amplify-ui-vue'
command: |
cd amplify-js/packages/amplify-ui-vue
yarn link
- run:
name: 'Install Vue Authenticator sample'
command: |
cd amplify-js-samples-staging-ui/samples/vue/auth/amplify-authenticator
yarn
yarn link aws-amplify
yarn link @aws-amplify/ui-vue
- run:
name: 'Start Vue Authenticator UI Sample server in background'
command: |
cd amplify-js-samples-staging-ui
yarn
yarn ci:test vue auth amplify-authenticator
- store_artifacts:
path: amplify-js-samples-staging-ui/cypress/videos
- store_artifacts:
path: amplify-js-samples-staging-ui/cypress/screenshots
integ_rn_ios_storage:
<<: *defaults_rn
working_directory: ~/amplify-js-samples-staging/samples/react-native/storage/StorageApp
steps:
- attach_workspace:
at: ~/
- run:
name: Yarn Install
command: yarn install --non-interactive --no-lockfile
# Metro Bundler doesn't work with linked packages so we're copying them from amplify-js
# TODO: utilize Verdaccio for this instead
- run:
name: 'Link aws-amplify'
command: |
cp -rf ~/amplify-js/packages/aws-amplify/dist/ ./node_modules/aws-amplify/dist/
cp -rf ~/amplify-js/packages/aws-amplify/lib/ ./node_modules/aws-amplify/lib/
cp -rf ~/amplify-js/packages/aws-amplify/lib-esm/ ./node_modules/aws-amplify/lib-esm/
cp -rf ~/amplify-js/packages/amazon-cognito-identity-js/dist/ ./node_modules/amazon-cognito-identity-js/dist/
cp -rf ~/amplify-js/packages/amazon-cognito-identity-js/lib/ ./node_modules/amazon-cognito-identity-js/lib
cp -rf ~/amplify-js/packages/analytics/dist/ ./node_modules/@aws-amplify/analytics/dist/
cp -rf ~/amplify-js/packages/analytics/lib/ ./node_modules/@aws-amplify/analytics/lib/
cp -rf ~/amplify-js/packages/analytics/lib-esm/ ./node_modules/@aws-amplify/analytics/lib-esm/
cp -rf ~/amplify-js/packages/api/dist/ ./node_modules/@aws-amplify/api/dist/
cp -rf ~/amplify-js/packages/api/lib/ ./node_modules/@aws-amplify/api/lib/
cp -rf ~/amplify-js/packages/api/lib-esm/ ./node_modules/@aws-amplify/api/lib-esm/
cp -rf ~/amplify-js/packages/auth/dist/ ./node_modules/@aws-amplify/auth/dist/
cp -rf ~/amplify-js/packages/auth/lib/ ./node_modules/@aws-amplify/auth/lib/
cp -rf ~/amplify-js/packages/auth/lib-esm/ ./node_modules/@aws-amplify/auth/lib-esm/
cp -rf ~/amplify-js/packages/cache/dist/ ./node_modules/@aws-amplify/cache/dist/
cp -rf ~/amplify-js/packages/cache/lib/ ./node_modules/@aws-amplify/cache/lib/
cp -rf ~/amplify-js/packages/cache/lib-esm/ ./node_modules/@aws-amplify/cache/lib-esm/
cp -rf ~/amplify-js/packages/core/dist/ ./node_modules/@aws-amplify/core/dist/
cp -rf ~/amplify-js/packages/core/lib/ ./node_modules/@aws-amplify/core/lib/
cp -rf ~/amplify-js/packages/core/lib-esm/ ./node_modules/@aws-amplify/core/lib-esm/
cp -rf ~/amplify-js/packages/interactions/dist/ ./node_modules/@aws-amplify/interactions/dist/
cp -rf ~/amplify-js/packages/interactions/lib/ ./node_modules/@aws-amplify/interactions/lib/
cp -rf ~/amplify-js/packages/interactions/lib-esm/ ./node_modules/@aws-amplify/interactions/lib-esm/
cp -rf ~/amplify-js/packages/predictions/dist/ ./node_modules/@aws-amplify/predictions/dist/
cp -rf ~/amplify-js/packages/predictions/lib/ ./node_modules/@aws-amplify/predictions/lib/
cp -rf ~/amplify-js/packages/predictions/lib-esm/ ./node_modules/@aws-amplify/predictions/lib-esm/
cp -rf ~/amplify-js/packages/pubsub/dist/ ./node_modules/@aws-amplify/pubsub/dist/
cp -rf ~/amplify-js/packages/pubsub/lib/ ./node_modules/@aws-amplify/pubsub/lib/
cp -rf ~/amplify-js/packages/pubsub/lib-esm/ ./node_modules/@aws-amplify/pubsub/lib-esm/
cp -rf ~/amplify-js/packages/storage/dist/ ./node_modules/@aws-amplify/storage/dist/
cp -rf ~/amplify-js/packages/storage/lib/ ./node_modules/@aws-amplify/storage/lib/
cp -rf ~/amplify-js/packages/storage/lib-esm/ ./node_modules/@aws-amplify/storage/lib-esm/
cp -rf ~/amplify-js/packages/amplify-ui/dist/ ./node_modules/@aws-amplify/ui/dist/
cp -rf ~/amplify-js/packages/amplify-ui/lib/ ./node_modules/@aws-amplify/ui/lib/
cp -rf ~/amplify-js/packages/xr/dist/ ./node_modules/@aws-amplify/xr/dist/
cp -rf ~/amplify-js/packages/xr/lib/ ./node_modules/@aws-amplify/xr/lib/
cp -rf ~/amplify-js/packages/xr/lib-esm/ ./node_modules/@aws-amplify/xr/lib-esm/
- restore_pods
- run:
name: Install CocoaPods
command: |
cd ios
pod install
- save_pods
- run:
background: true
command: xcrun simctl boot "iPhone 11" || true
name: Start iOS simulator (background)
- run:
background: true
command: yarn start
name: Start Metro Packager (background)
- run:
name: Configure Detox
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
command: |
brew tap wix/brew
brew install applesimutils
yarn global add detox-cli
- run:
name: Detox Build
command: detox build -c ios.sim.debug
- run:
environment:
JEST_JUNIT_OUTPUT_DIR: 'reports/junit'
JEST_JUNIT_OUTPUT_NAME: 'detox-test-results.xml'
name: Detox Test
command: detox test -c ios.sim.debug -u
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit
deploy:
<<: *defaults
working_directory: ~/amplify-js
steps:
- attach_workspace:
at: /root
- restore_cache:
keys:
- amplify-ssh-deps-{{ .Branch }}
- amplify-ssh-deps
- run:
name: 'Publish to Amplify Package'
command: |
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm whoami
git config --global user.email $GITHUB_EMAIL
git config --global user.name $GITHUB_USER
git status
git --no-pager diff
yarn run publish:$CIRCLE_BRANCH
else
echo "Skipping deploy."
fi
workflows:
version: 2
build_test_deploy:
jobs:
- build
- unit_test:
requires:
- build
- integ_setup_ui:
filters:
branches:
only:
- release
- master
- ui-components/master
- 1.0-stable
requires:
- build
- integ_react_auth_ui:
filters:
branches:
only:
- release
- master
- ui-components/master
- 1.0-stable
requires:
- integ_setup_ui
- integ_angular_auth_ui:
filters:
branches:
only:
- release
- master
- ui-components/master
- 1.0-stable
requires:
- integ_setup_ui
- integ_vue_auth_ui:
filters:
branches:
only:
- release
- master
- ui-components/master
- 1.0-stable
requires:
- integ_setup_ui
- integ_setup:
filters:
branches:
only:
- release
- master
- ui-components/master
- 1.0-stable
requires:
- build
- integ_react_predictions:
filters:
branches:
only:
- release
- master
- ui-components/master
- 1.0-stable
requires:
- integ_setup
- integ_react_auth:
filters:
branches:
only:
- release
- master
- ui-components/master
- 1.0-stable
requires:
- integ_setup
- integ_angular_auth:
filters:
branches:
only:
- release
- master
- 1.0-stable
requires:
- integ_setup
- integ_vue_auth:
filters:
branches:
only:
- release
- master
- 1.0-stable
requires:
- integ_setup
- integ_rn_ios_storage:
filters:
branches:
only:
- release
- master
- 1.0-stable
requires:
- integ_setup
- deploy:
filters:
branches:
only:
- release
- master
- beta
- ui-components/master
- 1.0-stable
requires:
- unit_test
- integ_react_predictions
- integ_react_auth
- integ_angular_auth
- integ_vue_auth
- integ_rn_ios_storage