@@ -5,12 +5,21 @@ version: 2.1
5
5
aliases :
6
6
- &environment
7
7
TZ : /usr/share/zoneinfo/America/Los_Angeles
8
+ NODE_OPTIONS : " --max-old-space-size=6144"
8
9
9
10
executors :
10
- linux :
11
+ linux-node-14-browsers :
11
12
resource_class : medium+
12
13
docker :
13
14
- image : cimg/node:14.18-browsers
15
+ linux-node-14 :
16
+ resource_class : large
17
+ docker :
18
+ - image : cimg/node:14.18
19
+ linux-node-12 :
20
+ resource_class : large
21
+ docker :
22
+ - image : cimg/node:12.22.7
14
23
windows : win/default
15
24
16
25
orbs :
@@ -22,26 +31,91 @@ orbs:
22
31
# Define a job to be invoked later in a workflow.
23
32
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
24
33
jobs :
34
+ build-and-test :
35
+ parameters :
36
+ executor :
37
+ type : string
38
+ executor : << parameters.executor >>
39
+ environment : *environment
40
+ steps :
41
+ - checkout
42
+
43
+ - restore_cache :
44
+ name : Restore yarn cache
45
+ keys :
46
+ - v3-node-{{ arch }}-<< parameters.executor >>-build-{{ checksum "yarn.lock" }}
47
+ - v3-node-{{ arch }}-<< parameters.executor >>-build-
48
+
49
+ - run :
50
+ name : Setup yarn
51
+ command : yarn install --immutable --inline-builds
52
+
53
+ - run :
54
+ name : Run yarn build
55
+ command : yarn build
56
+
57
+ - when :
58
+ condition :
59
+ equal : [<< pipeline.git.branch >>, "master"]
60
+ environment :
61
+ AWS_DEFAULT_REGION : us-east-1
62
+ GITHUB_SHA : << pipeline.git.revision >>
63
+ steps :
64
+ - run :
65
+ name : Upload handler sizes to S3
66
+ command : yarn handlers:upload-handler-sizes
67
+
68
+ - run :
69
+ name : Run unit tests
70
+ command : yarn test:ci
71
+ environment :
72
+ JEST_JUNIT_OUTPUT_DIR : ./reports/junit/unit-tests
73
+
74
+ - run :
75
+ name : Run integration tests
76
+ command : yarn integration:ci
77
+ environment :
78
+ JEST_JUNIT_OUTPUT_DIR : ./reports/junit/integration-tests
79
+
80
+ - run :
81
+ name : Upload code coverage
82
+ command : npx codecov
83
+
84
+ - store_test_results :
85
+ path : ./reports/junit/unit-tests
86
+
87
+ - store_test_results :
88
+ path : ./reports/junit/integration-tests
89
+
90
+ - store_artifacts :
91
+ path : ./reports/junit
92
+
93
+ - save_cache :
94
+ name : Save yarn cache
95
+ key : v3-node-{{ arch }}-<< parameters.executor >>-build-{{ checksum "yarn.lock" }}
96
+ paths :
97
+ - ~/project/.yarn/cache
98
+
25
99
run-e2e-tests :
26
100
parameters :
27
- os :
101
+ executor :
28
102
type : string
29
103
app :
30
104
type : string
31
- executor : << parameters.os >>
105
+ executor : << parameters.executor >>
32
106
environment : *environment
33
107
steps :
34
108
- checkout
35
109
36
110
- when :
37
111
condition :
38
- equal : [<< parameters.os >>, "linux"]
112
+ equal : [<< parameters.executor >>, "linux-node-14-browsers "]
39
113
steps :
40
114
- aws-cli-linux/install
41
115
42
116
- when :
43
117
condition :
44
- equal : [<< parameters.os >>, "windows"]
118
+ equal : [<< parameters.executor >>, "windows"]
45
119
steps :
46
120
- run :
47
121
name : Install AWS CLI v1
@@ -55,21 +129,15 @@ jobs:
55
129
56
130
- run :
57
131
name : Setup yarn
58
- environment :
59
- NODE_OPTIONS : " --max-old-space-size=6144"
60
132
command : yarn install --immutable --inline-builds
61
133
62
134
- run :
63
135
name : Run yarn build
64
- environment :
65
- NODE_OPTIONS : " --max-old-space-size=6144"
66
136
command : yarn build
67
137
68
138
- run :
69
139
name : Build serverless-patched
70
140
working_directory : ~/project/packages/serverless-patched
71
- environment :
72
- NODE_OPTIONS : " --max-old-space-size=6144"
73
141
command : |
74
142
yarn install --immutable
75
143
yarn build
@@ -91,64 +159,70 @@ jobs:
91
159
environment :
92
160
AWS_DEFAULT_REGION : us-east-1
93
161
WAIT_TIMEOUT : 900
94
- NODE_OPTIONS : " --max-old-space-size=6144"
95
162
SERVERLESS_CI : true
96
163
command : |
97
164
yarn install --immutable
98
165
yarn e2e:ci
99
166
no_output_timeout : 30m # In case something goes wrong
100
167
101
168
- save_cache :
102
- name : Save yarn cache for future installs
169
+ name : Save yarn cache
103
170
key : v3-node-{{ arch }}-<< parameters.app >>-{{ checksum "yarn.lock" }}
104
171
paths :
105
172
- ~/project/.yarn/cache
106
173
107
174
# Invoke jobs via workflows
108
175
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
109
176
workflows :
110
- e2e-tests :
177
+ build :
111
178
jobs :
112
- - queue/block_workflow :
113
- consider-branch : false
114
- time : " 90"
115
- filters :
116
- branches :
117
- ignore : /renovate\/.*/
118
- - run-e2e-tests :
119
- filters :
120
- branches :
121
- ignore : /renovate\/.*/
122
- requires :
123
- - queue/block_workflow
124
- matrix :
125
- parameters :
126
- os :
127
- - linux
128
- app :
129
- # Current minor version of Next.js
130
- - next-app
131
- - next-app-experimental
132
- - next-app-using-serverless-trace
133
- - next-app-with-trailing-slash
134
- - next-app-with-base-path
135
- - next-app-dynamic-routes
136
- - next-app-with-locales
137
- - next-app-with-locales-using-serverless-trace
138
- # Previous minor version of Next.js
139
- - prev-next-app
140
- - prev-next-app-with-trailing-slash
141
- - prev-next-app-with-base-path
142
- - prev-next-app-dynamic-routes
143
- - run-e2e-tests :
144
- filters :
145
- branches :
146
- ignore : /renovate\/.*/
147
- requires :
148
- - queue/block_workflow
179
+ - build-and-test :
149
180
matrix :
150
181
parameters :
151
- os :
152
- - windows
153
- app :
154
- - next-app-windows
182
+ executor :
183
+ - linux-node-14
184
+ - linux-node-12
185
+ # e2e-tests:
186
+ # - queue/block_workflow:
187
+ # consider-branch: false
188
+ # time: "90"
189
+ # filters:
190
+ # branches:
191
+ # ignore: /renovate\/.*/
192
+ # - run-e2e-tests:
193
+ # filters:
194
+ # branches:
195
+ # ignore: /renovate\/.*/
196
+ # requires:
197
+ # - queue/block_workflow
198
+ # matrix:
199
+ # parameters:
200
+ # executor:
201
+ # - linux-node-14-browsers
202
+ # app:
203
+ # # Current minor version of Next.js
204
+ # - next-app
205
+ # - next-app-experimental
206
+ # - next-app-using-serverless-trace
207
+ # - next-app-with-trailing-slash
208
+ # - next-app-with-base-path
209
+ # - next-app-dynamic-routes
210
+ # - next-app-with-locales
211
+ # - next-app-with-locales-using-serverless-trace
212
+ # # Previous minor version of Next.js
213
+ # - prev-next-app
214
+ # - prev-next-app-with-trailing-slash
215
+ # - prev-next-app-with-base-path
216
+ # - prev-next-app-dynamic-routes
217
+ # - run-e2e-tests:
218
+ # filters:
219
+ # branches:
220
+ # ignore: /renovate\/.*/
221
+ # requires:
222
+ # - queue/block_workflow
223
+ # matrix:
224
+ # parameters:
225
+ # executor:
226
+ # - windows
227
+ # app:
228
+ # - next-app-windows
0 commit comments