@@ -38,7 +38,7 @@ var_6: &save_cache
38
38
save_cache :
39
39
key : *cache_key
40
40
paths :
41
- - " node_modules "
41
+ - ~/.cache/yarn
42
42
43
43
# Job step that ensures that the node module dependencies are installed and up-to-date. We use
44
44
# Yarn with the frozen lockfile option in order to make sure that lock file and package.json are
@@ -59,15 +59,7 @@ var_8: &docker-firefox-image
59
59
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
60
60
var_9 : &attach_release_output
61
61
attach_workspace :
62
- at : dist/releases
63
-
64
- # Anchor that can be used to download and install Yarn globally in the bash environment.
65
- var_10 : &yarn_download
66
- run :
67
- name : " Downloading and installing Yarn"
68
- command : |
69
- touch $BASH_ENV
70
- curl -o- -L https://yarnpkg.com/install.sh | PROFILE=$BASH_ENV bash -s -- --version "1.19.1"
62
+ at : .
71
63
72
64
# -----------------------------
73
65
# Container version of CircleCI
@@ -79,7 +71,6 @@ version: 2
79
71
# must be part of a workflow definition in order to run for PRs and push builds.
80
72
# -----------------------------------------------------------------------------------------
81
73
jobs :
82
-
83
74
# -----------------------------------
84
75
# Build job
85
76
# -----------------------------------
@@ -88,15 +79,21 @@ jobs:
88
79
steps :
89
80
- *checkout_code
90
81
- *restore_cache
91
- - *yarn_download
92
82
- *yarn_install
93
83
94
- - run : yarn gulp :publish: build-releases
84
+ - run : yarn build
95
85
96
86
# Note: We want to save the cache in this job because the workspace cache also
97
87
# includes the build cache that will be updated in this job.
98
88
- *save_cache
99
89
90
+ # Store the release output in the workspace storage. This means that other jobs
91
+ # in the same workflow can attach the release output to their job.
92
+ - persist_to_workspace :
93
+ root : ' .'
94
+ paths :
95
+ - node_modules
96
+ - dist/releases
100
97
# ------------------------------------------------------------------------------------------
101
98
# Job that runs the unit tests on locally installed browsers (Chrome and Firefox headless).
102
99
# The available browsers are installed through the angular/ngcontainer Docker image.
@@ -105,10 +102,7 @@ jobs:
105
102
docker : *docker-firefox-image
106
103
steps :
107
104
- *checkout_code
108
- - *restore_cache
109
- - *yarn_download
110
- - *yarn_install
111
-
105
+ - *attach_release_output
112
106
- run : ./scripts/circleci/run-local-browser-tests.sh
113
107
114
108
# ----------------------------------------------------------------------------
@@ -118,14 +112,12 @@ jobs:
118
112
tests_browserstack :
119
113
<< : *job_defaults
120
114
environment :
121
- BROWSER_STACK_USERNAME : " adamplumer1"
122
- BROWSER_STACK_ACCESS_KEY : " WgLjxoB2zQ3tqmsznKnz"
115
+ BROWSER_STACK_USERNAME : ' adamplumer1'
116
+ BROWSER_STACK_ACCESS_KEY : ' WgLjxoB2zQ3tqmsznKnz'
123
117
steps :
124
118
- *checkout_code
125
119
- *restore_cache
126
- - *yarn_download
127
- - *yarn_install
128
-
120
+ - *attach_release_output
129
121
- run : ./scripts/circleci/run-browserstack-tests.sh
130
122
131
123
# ----------------------------------------------------------------------------
@@ -135,16 +127,14 @@ jobs:
135
127
tests_saucelabs :
136
128
<< : *job_defaults
137
129
environment :
138
- SAUCE_USERNAME : " angular-flex-layout"
139
- SAUCE_ACCESS_KEY : " fa20eb1f457c-1f1a-c4c4-41ea-ef9e7f13"
130
+ SAUCE_USERNAME : ' angular-flex-layout'
131
+ SAUCE_ACCESS_KEY : ' fa20eb1f457c-1f1a-c4c4-41ea-ef9e7f13'
140
132
# Note: This number should not be too high because otherwise we might run into
141
133
# a rate limit exception.
142
134
KARMA_PARALLEL_BROWSERS : 2
143
135
steps :
144
136
- *checkout_code
145
- - *restore_cache
146
- - *yarn_download
147
- - *yarn_install
137
+ - *attach_release_output
148
138
149
139
- run : ./scripts/circleci/run-saucelabs-tests.sh
150
140
@@ -156,50 +146,22 @@ jobs:
156
146
steps :
157
147
- *checkout_code
158
148
- *restore_cache
159
- - *yarn_download
160
- - *yarn_install
149
+ - *attach_release_output
161
150
162
- - run : yarn gulp ci :ssr
151
+ - run : yarn test :ssr
163
152
164
153
# -------------------------------------------------------------------------
165
154
# Job that pre-render's the universal app with `@angular/platform-server`.
166
155
# This verifies that Angular Layout can be rendered within Node.
167
156
# -------------------------------------------------------------------------
168
- prerender_build :
169
- << : *job_defaults
170
- steps :
171
- - *checkout_code
172
- - *restore_cache
173
- - *yarn_download
174
- - *yarn_install
175
-
176
- - run : yarn gulp ci:prerender
177
-
178
- # -------------------------------------------------------------------------
179
- # Job that makes sure Angular Layout can be integrated with a basic app
180
- # -------------------------------------------------------------------------
181
- hello_world_build :
182
- << : *job_defaults
183
- steps :
184
- - *checkout_code
185
- - *restore_cache
186
- - *yarn_download
187
- - *yarn_install
188
-
189
- - run : yarn gulp ci:hw
190
-
191
- # -------------------------------------------------------------------------
192
- # Job that makes sure Angular Layout can be integrated with the demo app
193
- # -------------------------------------------------------------------------
194
- aot_build :
157
+ integration_tests :
195
158
<< : *job_defaults
196
159
steps :
197
160
- *checkout_code
198
- - *restore_cache
199
- - *yarn_download
200
- - *yarn_install
161
+ - *attach_release_output
201
162
202
- - run : yarn gulp ci:aot
163
+ - run : yarn ng build demo-app
164
+ - run : yarn build:universal-demo-app
203
165
204
166
# ----------------------------------
205
167
# Lint job. Runs the gulp lint task.
@@ -209,50 +171,9 @@ jobs:
209
171
steps :
210
172
- *checkout_code
211
173
- *restore_cache
212
- - *yarn_download
213
- - *yarn_install
214
-
215
- - run : yarn gulp ci:lint
216
-
217
- # -------------------------------------------------------------------------------------------
218
- # Job that builds all release packages with Gulp. The built packages can be then used in the
219
- # same workflow to publish snapshot builds or test the dev-app with the release packages.
220
- # -------------------------------------------------------------------------------------------
221
- build_release_packages :
222
- << : *job_defaults
223
- steps :
224
- - *checkout_code
225
- - *restore_cache
226
- - *yarn_download
227
174
- *yarn_install
228
175
229
- - run : yarn gulp ci:build-release-packages
230
-
231
- # Store the release output in the workspace storage. This means that other jobs
232
- # in the same workflow can attach the release output to their job.
233
- - persist_to_workspace :
234
- root : dist/releases
235
- paths :
236
- - " **/*"
237
-
238
- # Since there is no UMD bundle that includes everything, we need to move
239
- # all bundles into a directory. This allows us to store all UMD bundles as job
240
- # artifacts that can be picked up by the Angular Github bot.
241
- - run :
242
- name : Prepare artifacts for publish.
243
- command : |
244
- mkdir -p /tmp/layout-umd-minified-bundles
245
- cp dist/releases/flex-layout/bundles/*.umd.min.js /tmp/layout-umd-minified-bundles
246
- # Publish bundle artifacts which will be used to calculate the size change.
247
- # Note: Make sure that the size plugin from the Angular robot fetches the artifacts
248
- # from this CircleCI job (see .github/angular-robot.yml). Additionally any artifacts need to
249
- # be stored with the following path format: "{projectName}/{context}/{fileName}"
250
- # This format is necessary because otherwise the bot is not able to pick up the
251
- # artifacts from CircleCI. See:
252
- # https://github.com/angular/github-robot/blob/master/functions/src/plugins/size.ts#L392-L394
253
- - store_artifacts :
254
- path : /tmp/layout-umd-minified-bundles
255
- destination : /angular_layout/layout_release_output/
176
+ - run : yarn lint
256
177
257
178
# ----------------------------------------
258
179
# Job that publishes the build snapshots
@@ -268,10 +189,8 @@ jobs:
268
189
command : ' [[ -n ${CIRCLE_PR_NUMBER} ]] && circleci step halt || true'
269
190
270
191
- *checkout_code
271
- - *restore_cache
272
- - *yarn_download
273
- - *yarn_install
274
192
- *attach_release_output
193
+ - run : yarn stamp
275
194
276
195
# CircleCI has a config setting to enforce SSH for all github connections.
277
196
# This is not compatible with our mechanism of using a Personal Access Token
@@ -289,37 +208,33 @@ jobs:
289
208
# ----------------------------------------------------------------------------------------
290
209
workflows :
291
210
version : 2
292
-
293
- # Build and test workflow. A workflow includes multiple jobs that run in parallel. All jobs
294
- # that build and test source code should be part of this workflow
295
- build :
211
+ default_workflow :
296
212
jobs :
213
+ # Build and test workflow. A workflow includes multiple jobs that run in parallel. All jobs
214
+ # that build and test source code should be part of this workflow
297
215
- build
298
-
299
- unit_tests :
300
- jobs :
301
- - tests_local_browsers
302
- - tests_browserstack
303
- - tests_saucelabs
304
- - tests_ssr
305
-
306
- integration_tests :
307
- jobs :
308
- - prerender_build
309
- - hello_world_build
310
- - aot_build
311
-
312
- release_output :
313
- jobs :
314
- - build_release_packages
216
+ - lint
217
+ - tests_local_browsers :
218
+ requires :
219
+ - build
220
+ - tests_browserstack :
221
+ requires :
222
+ - build
223
+ - tests_saucelabs :
224
+ requires :
225
+ - build
226
+ - tests_ssr :
227
+ requires :
228
+ - build
229
+ - integration_tests :
230
+ requires :
231
+ - build
315
232
- publish_snapshots :
316
233
requires :
317
- - build_release_packages
318
-
319
- # Lint workflow. As we want to lint in one job, this is a workflow with just one job.
320
- lint :
321
- jobs :
322
- - lint
234
+ - tests_browserstack
235
+ - tests_saucelabs
236
+ - tests_local_browsers
237
+ - integration_tests
323
238
324
239
# ---------------------------
325
240
# General setup for CircleCI
0 commit comments