1
1
version : 2.1
2
2
orbs :
3
3
aws-ecr :
circleci/[email protected]
4
+
4
5
machine :
5
6
environment :
6
7
PATH : ' ${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin'
7
8
executors :
8
9
w : &windows-e2e-executor
9
10
machine :
10
- image : " windows-server-2019-vs2019:stable"
11
- resource_class : " windows.medium"
11
+ image : ' windows-server-2019-vs2019:stable'
12
+ resource_class : ' windows.medium'
12
13
shell : bash.exe
13
14
working_directory : ~/repo
14
15
environment :
@@ -24,11 +25,21 @@ executors:
24
25
AMPLIFY_DIR : /home/circleci/repo/out
25
26
AMPLIFY_PATH : /home/circleci/repo/out/amplify-pkg-linux-x64
26
27
28
+ m : &macos-e2e-executor
29
+ macos :
30
+ xcode : 14.1.0
31
+ working_directory : ~/repo
32
+ resource_class : large
33
+ environment :
34
+ CXXFLAGS : ' --std=c++17'
35
+ AMPLIFY_DIR : /home/circleci/repo/out
36
+ AMPLIFY_PATH : /home/circleci/repo/out/amplify-pkg-linux-x64
37
+
27
38
defaults : &defaults
28
39
working_directory : ~/repo
29
40
parameters :
30
- os :
31
- type : executor
41
+ os :
42
+ type : executor
32
43
33
44
install_cli_with_local_codegen : &install_cli
34
45
name : install Amplify CLI and amplify-app with local Amplify Codegen
@@ -42,7 +53,7 @@ install_cli_with_local_codegen: &install_cli
42
53
npm list --global --depth=1
43
54
unsetNpmRegistryUrl
44
55
working_directory : ~/repo
45
-
56
+
46
57
clean_up_e2e_resources : &cleanup_e2e
47
58
name : Clean up e2e resources
48
59
command : |
@@ -61,11 +72,11 @@ jobs:
61
72
- run : yarn cache clean --force
62
73
- run : yarn run production-build
63
74
- save_cache :
64
- key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
75
+ key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-<< parameters.os >>
65
76
paths :
66
77
- ~/.cache
67
78
- save_cache :
68
- key : amplify-codegen-ssh-deps-{{ .Branch }}
79
+ key : amplify-codegen-ssh-deps-{{ .Branch }}-<< parameters.os >>
69
80
paths :
70
81
- ~/.ssh
71
82
- persist_to_workspace :
79
90
- when :
80
91
condition :
81
92
or :
82
- - equal : [ *windows-e2e-executor, << parameters.os >> ]
93
+ - equal : [*windows-e2e-executor, << parameters.os >>]
83
94
steps :
84
95
- checkout
85
96
- run : nvm install 12.22.7
@@ -90,12 +101,12 @@ jobs:
90
101
- when :
91
102
condition :
92
103
or :
93
- - equal : [ *linux-e2e-executor, << parameters.os >> ]
104
+ - equal : [*linux-e2e-executor, << parameters.os >>]
94
105
steps :
95
106
- attach_workspace :
96
107
at : ./
97
108
- restore_cache :
98
- key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
109
+ key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-l
99
110
- run :
100
111
name : Lint
101
112
command : yarn lint
@@ -114,8 +125,8 @@ jobs:
114
125
at : ./
115
126
- restore_cache :
116
127
keys :
117
- - amplify-codegen-ssh-deps-{{ .Branch }}
118
- - amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
128
+ - amplify-codegen-ssh-deps-{{ .Branch }}-l
129
+ - amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-l
119
130
- run :
120
131
name : Authenticate with npm
121
132
command : echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
@@ -131,7 +142,7 @@ jobs:
131
142
- attach_workspace :
132
143
at : ./
133
144
- restore_cache :
134
- key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
145
+ key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-<< parameters.os >>
135
146
- run :
136
147
name : Publish to verdaccio
137
148
command : |
@@ -144,7 +155,7 @@ jobs:
144
155
yarn publish-to-verdaccio
145
156
unsetNpmRegistryUrl
146
157
- save_cache :
147
- key : amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
158
+ key : amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}-<< parameters.os >>
148
159
paths :
149
160
- ~/verdaccio-cache/
150
161
@@ -155,9 +166,31 @@ jobs:
155
166
- attach_workspace :
156
167
at : ./
157
168
- restore_cache :
158
- key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
169
+ key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-<< parameters.os >>
170
+ - restore_cache :
171
+ key : amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}-<< parameters.os >>
172
+ - run : *install_cli
173
+ - run :
174
+ name : Run e2e tests
175
+ command : |
176
+ cd packages/amplify-codegen-e2e-tests
177
+ yarn e2e --maxWorkers=3 $TEST_SUITE
178
+ no_output_timeout : 20m
179
+ - store_test_results :
180
+ path : packages/amplify-codegen-e2e-tests/
181
+ - store_artifacts :
182
+ path : ~/repo/packages/amplify-codegen-e2e-tests/amplify-e2e-reports
183
+
184
+ e2e-test-macos :
185
+ << : *defaults
186
+ executor : << parameters.os >>
187
+ steps :
188
+ - attach_workspace :
189
+ at : ./
190
+ - restore_cache :
191
+ key : amplify-codegen-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-<< parameters.os >>
159
192
- restore_cache :
160
- key : amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
193
+ key : amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}-<< parameters.os >>
161
194
- run : *install_cli
162
195
- run :
163
196
name : Run e2e tests
@@ -175,7 +208,7 @@ jobs:
175
208
executor : << parameters.os >>
176
209
steps :
177
210
- run : echo 'Done with Node CLI E2E Tests'
178
-
211
+
179
212
cleanup_resources :
180
213
<< : *defaults
181
214
executor : << parameters.os >>
@@ -218,18 +251,24 @@ workflows:
218
251
build_test_deploy :
219
252
jobs :
220
253
- build :
221
- os : l
254
+ name : build-<< matrix.os >>
255
+ matrix :
256
+ parameters :
257
+ os : [l, m]
222
258
- test :
223
259
name : test-<< matrix.os >>
224
260
matrix :
225
261
parameters :
226
262
os : [l, w]
227
263
requires :
228
- - build
264
+ - build-l
229
265
- publish_to_local_registry :
230
- os : l
266
+ name : publish_to_local_registry-<< matrix.os >>
267
+ matrix :
268
+ parameters :
269
+ os : [l, m]
231
270
requires :
232
- - build
271
+ - build-<< matrix.os >>
233
272
filters :
234
273
branches :
235
274
only :
@@ -241,7 +280,7 @@ workflows:
241
280
- cleanup-resources
242
281
os : l
243
282
requires :
244
- - publish_to_local_registry
283
+ - publish_to_local_registry-l
245
284
post-steps :
246
285
- run : *cleanup_e2e
247
286
filters :
@@ -266,4 +305,4 @@ workflows:
266
305
- done_with_node_e2e_tests :
267
306
os : l
268
307
requires :
269
- - e2e-test
308
+ - e2e-test
0 commit comments