1
1
version : 2.1
2
2
orbs :
3
3
aws-ecr :
circleci/[email protected]
4
+ android :
circleci/[email protected]
5
+
4
6
machine :
5
7
environment :
6
8
PATH : ' ${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin'
7
9
executors :
8
10
w : &windows-e2e-executor
9
11
machine :
10
- image : " windows-server-2019-vs2019:stable"
11
- resource_class : " windows.medium"
12
+ image : ' windows-server-2019-vs2019:stable'
13
+ resource_class : ' windows.medium'
12
14
shell : bash.exe
13
15
working_directory : ~/repo
14
16
environment :
@@ -24,11 +26,30 @@ executors:
24
26
AMPLIFY_DIR : /home/circleci/repo/out
25
27
AMPLIFY_PATH : /home/circleci/repo/out/amplify-pkg-linux-x64
26
28
29
+ m : &macos-e2e-executor
30
+ macos :
31
+ xcode : 14.1.0
32
+ working_directory : ~/repo
33
+ resource_class : large
34
+ environment :
35
+ CXXFLAGS : ' --std=c++17'
36
+ AMPLIFY_DIR : /home/circleci/repo/out
37
+ AMPLIFY_PATH : /home/circleci/repo/out/amplify-pkg-linux-x64
38
+
39
+ a : &android-e2e-executor
40
+ docker :
41
+ - image : cimg/android:2022.09
42
+ working_directory : ~/repo
43
+ resource_class : large
44
+ environment :
45
+ AMPLIFY_DIR : /home/circleci/repo/out
46
+ AMPLIFY_PATH : /home/circleci/repo/out/amplify-pkg-linux-x64
47
+
27
48
defaults : &defaults
28
49
working_directory : ~/repo
29
50
parameters :
30
- os :
31
- type : executor
51
+ os :
52
+ type : executor
32
53
33
54
install_cli_with_local_codegen : &install_cli
34
55
name : install Amplify CLI and amplify-app with local Amplify Codegen
@@ -42,7 +63,7 @@ install_cli_with_local_codegen: &install_cli
42
63
npm list --global --depth=1
43
64
unsetNpmRegistryUrl
44
65
working_directory : ~/repo
45
-
66
+
46
67
clean_up_e2e_resources : &cleanup_e2e
47
68
name : Clean up e2e resources
48
69
command : |
@@ -61,11 +82,11 @@ jobs:
61
82
- run : yarn cache clean --force
62
83
- run : yarn run production-build
63
84
- save_cache :
64
- key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
85
+ key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-<< parameters.os >>
65
86
paths :
66
87
- ~/.cache
67
88
- save_cache :
68
- key : amplify-codegen-ssh-deps-{{ .Branch }}
89
+ key : amplify-codegen-ssh-deps-{{ .Branch }}-<< parameters.os >>
69
90
paths :
70
91
- ~/.ssh
71
92
- persist_to_workspace :
79
100
- when :
80
101
condition :
81
102
or :
82
- - equal : [ *windows-e2e-executor, << parameters.os >> ]
103
+ - equal : [*windows-e2e-executor, << parameters.os >>]
83
104
steps :
84
105
- checkout
85
106
- run : nvm install 12.22.7
@@ -90,12 +111,12 @@ jobs:
90
111
- when :
91
112
condition :
92
113
or :
93
- - equal : [ *linux-e2e-executor, << parameters.os >> ]
114
+ - equal : [*linux-e2e-executor, << parameters.os >>]
94
115
steps :
95
116
- attach_workspace :
96
117
at : ./
97
118
- restore_cache :
98
- key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
119
+ key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-l
99
120
- run :
100
121
name : Lint
101
122
command : yarn lint
@@ -114,8 +135,8 @@ jobs:
114
135
at : ./
115
136
- restore_cache :
116
137
keys :
117
- - amplify-codegen-ssh-deps-{{ .Branch }}
118
- - amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
138
+ - amplify-codegen-ssh-deps-{{ .Branch }}-l
139
+ - amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-l
119
140
- run :
120
141
name : Authenticate with npm
121
142
command : echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
@@ -131,7 +152,7 @@ jobs:
131
152
- attach_workspace :
132
153
at : ./
133
154
- restore_cache :
134
- key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
155
+ key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-<< parameters.os >>
135
156
- run :
136
157
name : Publish to verdaccio
137
158
command : |
@@ -144,11 +165,55 @@ jobs:
144
165
yarn publish-to-verdaccio
145
166
unsetNpmRegistryUrl
146
167
- save_cache :
147
- key : amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
168
+ key : amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}-<< parameters.os >>
148
169
paths :
149
170
- ~/verdaccio-cache/
150
171
151
172
e2e-test :
173
+ << : *defaults
174
+ executor : << parameters.os >>
175
+ steps :
176
+ - attach_workspace :
177
+ at : ./
178
+ - restore_cache :
179
+ key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-<< parameters.os >>
180
+ - restore_cache :
181
+ key : amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}-<< parameters.os >>
182
+ - run : *install_cli
183
+ - run :
184
+ name : Run e2e tests
185
+ command : |
186
+ cd packages/amplify-codegen-e2e-tests
187
+ yarn e2e --maxWorkers=3 $TEST_SUITE
188
+ no_output_timeout : 20m
189
+ - store_test_results :
190
+ path : packages/amplify-codegen-e2e-tests/
191
+ - store_artifacts :
192
+ path : ~/repo/packages/amplify-codegen-e2e-tests/amplify-e2e-reports
193
+
194
+ e2e-test-macos :
195
+ << : *defaults
196
+ executor : << parameters.os >>
197
+ steps :
198
+ - attach_workspace :
199
+ at : ./
200
+ - restore_cache :
201
+ key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-<< parameters.os >>
202
+ - restore_cache :
203
+ key : amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}-<< parameters.os >>
204
+ - run : *install_cli
205
+ - run :
206
+ name : Run e2e tests
207
+ command : |
208
+ cd packages/amplify-codegen-e2e-tests
209
+ yarn e2e --maxWorkers=3 $TEST_SUITE
210
+ no_output_timeout : 20m
211
+ - store_test_results :
212
+ path : packages/amplify-codegen-e2e-tests/
213
+ - store_artifacts :
214
+ path : ~/repo/packages/amplify-codegen-e2e-tests/amplify-e2e-reports
215
+
216
+ e2e-test-with-node-install :
152
217
<< : *defaults
153
218
executor : << parameters.os >>
154
219
steps :
@@ -158,6 +223,10 @@ jobs:
158
223
key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
159
224
- restore_cache :
160
225
key : amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
226
+ - node/install :
227
+ install-yarn : true
228
+ node-version : ' 16.13'
229
+ - run : yarn run production-build
161
230
- run : *install_cli
162
231
- run :
163
232
name : Run e2e tests
@@ -175,7 +244,7 @@ jobs:
175
244
executor : << parameters.os >>
176
245
steps :
177
246
- run : echo 'Done with Node CLI E2E Tests'
178
-
247
+
179
248
cleanup_resources :
180
249
<< : *defaults
181
250
executor : << parameters.os >>
@@ -218,18 +287,24 @@ workflows:
218
287
build_test_deploy :
219
288
jobs :
220
289
- build :
221
- os : l
290
+ name : build-<< matrix.os >>
291
+ matrix :
292
+ parameters :
293
+ os : [l, m]
222
294
- test :
223
295
name : test-<< matrix.os >>
224
296
matrix :
225
297
parameters :
226
298
os : [l, w]
227
299
requires :
228
- - build
300
+ - build-l
229
301
- publish_to_local_registry :
230
- os : l
302
+ name : publish_to_local_registry-<< matrix.os >>
303
+ matrix :
304
+ parameters :
305
+ os : [l, m]
231
306
requires :
232
- - build
307
+ - build-<< matrix.os >>
233
308
filters :
234
309
branches :
235
310
only :
@@ -241,7 +316,7 @@ workflows:
241
316
- cleanup-resources
242
317
os : l
243
318
requires :
244
- - publish_to_local_registry
319
+ - publish_to_local_registry-l
245
320
post-steps :
246
321
- run : *cleanup_e2e
247
322
filters :
@@ -266,4 +341,4 @@ workflows:
266
341
- done_with_node_e2e_tests :
267
342
os : l
268
343
requires :
269
- - e2e-test
344
+ - e2e-test
0 commit comments