@@ -64,7 +64,7 @@ var_9: &docker-firefox-image
64
64
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
65
65
var_10 : &attach_release_output
66
66
attach_workspace :
67
- at : dist/releases
67
+ at : dist/releases
68
68
69
69
# -----------------------------
70
70
# Container version of CircleCI
@@ -88,27 +88,12 @@ jobs:
88
88
- *restore_cache
89
89
- *copy_bazel_config
90
90
91
- # TODO(jelbourn): Update this command to run all tests if the Bazel issues have been fixed.
92
91
- run : bazel build src/...
93
- - run : bazel test src/...
92
+ - run : bazel test src/... tools/public_api_guard/...
94
93
95
- # ------------------------------------------------------------------------------------------
96
- # Job that runs the unit tests on locally installed browsers (Chrome and Firefox headless).
97
- # The available browsers are installed through the angular/ngcontainer Docker image.
98
- # ------------------------------------------------------------------------------------------
99
- tests_local_browsers :
100
- docker : *docker-firefox-image
101
- resource_class : xlarge
102
- environment :
103
- TEST_PLATFORM : local
104
- steps :
105
- - *checkout_code
106
- - *restore_cache
107
- - *yarn_install
108
-
109
- # Launches the unit tests. The platform is determined by the "TEST_PLATFORM" environment
110
- # variable which has been configured above
111
- - run : yarn gulp ci:test
94
+ # Note: We want to save the cache in this job because the workspace cache also
95
+ # includes the Bazel repository cache that will be updated in this job.
96
+ - *save_cache
112
97
113
98
# ----------------------------------------------------------------
114
99
# Job that runs the e2e tests with Protractor and Chrome Headless
@@ -123,6 +108,20 @@ jobs:
123
108
124
109
- run : yarn gulp ci:e2e
125
110
111
+ # ------------------------------------------------------------------------------------------
112
+ # Job that runs the unit tests on locally installed browsers (Chrome and Firefox headless).
113
+ # The available browsers are installed through the angular/ngcontainer Docker image.
114
+ # ------------------------------------------------------------------------------------------
115
+ tests_local_browsers :
116
+ docker : *docker-firefox-image
117
+ resource_class : xlarge
118
+ steps :
119
+ - *checkout_code
120
+ - *restore_cache
121
+ - *yarn_install
122
+
123
+ - run : ./scripts/circleci/run-local-browser-tests.sh
124
+
126
125
# ----------------------------------------------------------------------------
127
126
# Job that runs the unit tests on Browserstack. The browsers that will be used
128
127
# to run the unit tests on Browserstack are set in: test/browser-providers.js
@@ -133,19 +132,38 @@ jobs:
133
132
environment :
134
133
BROWSER_STACK_USERNAME : " angularteam1"
135
134
BROWSER_STACK_ACCESS_KEY : " CaXMeMHD9pr5PHg8N7Jq"
136
- parallelism : 2
137
135
steps :
138
136
- *checkout_code
139
137
- *restore_cache
140
138
- *yarn_install
141
139
142
140
- run : ./scripts/circleci/run-browserstack-tests.sh
143
141
142
+ # ----------------------------------------------------------------------------
143
+ # Job that runs the unit tests on Saucelabs. The browsers that will be used
144
+ # to run the unit tests on Saucelabs are set in: test/browser-providers.js
145
+ # ----------------------------------------------------------------------------
146
+ tests_saucelabs :
147
+ << : *job_defaults
148
+ resource_class : xlarge
149
+ environment :
150
+ SAUCE_USERNAME : " angular-ci"
151
+ SAUCE_ACCESS_KEY : " 9b988f434ff8-fbca-8aa4-4ae3-35442987"
152
+ # Note: This number should not be too high because otherwise we might run into
153
+ # a rate limit exception.
154
+ KARMA_PARALLEL_BROWSERS : 2
155
+ steps :
156
+ - *checkout_code
157
+ - *restore_cache
158
+ - *yarn_install
159
+
160
+ - run : ./scripts/circleci/run-saucelabs-tests.sh
161
+
144
162
# -----------------------------------------------------------------------------------------
145
- # Job that builds the demo -app with AOT. In order to speed up this job, the release output
163
+ # Job that builds the dev -app with AOT. In order to speed up this job, the release output
146
164
# from the workspace storage will be attached to this job.
147
165
# -----------------------------------------------------------------------------------------
148
- build_demoapp_aot :
166
+ build_devapp_aot :
149
167
<< : *job_defaults
150
168
steps :
151
169
- *checkout_code
@@ -182,7 +200,7 @@ jobs:
182
200
183
201
# -------------------------------------------------------------------------------------------
184
202
# Job that builds all release packages with Gulp. The built packages can be then used in the
185
- # same workflow to publish snapshot builds or test the demo -app with the release packages.
203
+ # same workflow to publish snapshot builds or test the dev -app with the release packages.
186
204
# -------------------------------------------------------------------------------------------
187
205
build_release_packages :
188
206
<< : *job_defaults
@@ -201,7 +219,68 @@ jobs:
201
219
paths :
202
220
- " **/*"
203
221
204
- - *save_cache
222
+ # Since there is no UMD bundle that includes everything from the CDK, we need to move
223
+ # all bundles into a directory. This allows us to store all CDK UMD bundles as job
224
+ # artifacts that can be picked up by the Angular Github bot.
225
+ - run :
226
+ name : Prepare CDK artifacts for publish.
227
+ command : |
228
+ mkdir -p /tmp/cdk-umd-minified-bundles
229
+ cp dist/releases/cdk/bundles/*.umd.min.js /tmp/cdk-umd-minified-bundles
230
+
231
+ # Publish bundle artifacts which will be used to calculate the size change.
232
+ # Note: Make sure that the size plugin from the Angular robot fetches the artifacts
233
+ # from this CircleCI job (see .github/angular-robot.yml). Additionally any artifacts need to
234
+ # be stored with the following path format: "{projectName}/{context}/{fileName}"
235
+ # This format is necessary because otherwise the bot is not able to pick up the
236
+ # artifacts from CircleCI. See:
237
+ # https://github.com/angular/github-robot/blob/master/functions/src/plugins/size.ts#L392-L394
238
+ - store_artifacts :
239
+ path : dist/releases/material/bundles/material.umd.min.js
240
+ destination : /angular_material/material_release_output/material.umd.min.js
241
+ - store_artifacts :
242
+ path : /tmp/cdk-umd-minified-bundles
243
+ destination : /angular_material/cdk_release_output/
244
+
245
+ # ----------------------------------------
246
+ # Job that publishes the build snapshots
247
+ # ----------------------------------------
248
+ publish_snapshots :
249
+ << : *job_defaults
250
+ steps :
251
+ # Since CircleCI currently does not have any way to easily restrict jobs to only run
252
+ # for push builds, we need to manually skip publishing if the jobs runs for a PR.
253
+ # https://discuss.circleci.com/t/workflows-pull-request-filter/14396/11
254
+ - run :
255
+ name : Check whether this job should be skipped.
256
+ command : ' [[ -n ${CIRCLE_PR_NUMBER} ]] && circleci step halt || true'
257
+
258
+ - *checkout_code
259
+ - *restore_cache
260
+ - *yarn_install
261
+ - *attach_release_output
262
+
263
+ # CircleCI has a config setting to enforce SSH for all github connections.
264
+ # This is not compatible with our mechanism of using a Personal Access Token
265
+ # to publish the build snapshots. In order to fix this, we unset the global option.
266
+ -
run :
git config --global --unset "url.ssh://[email protected] "
267
+
268
+ - run : ./scripts/circleci/publish-snapshots.sh
269
+
270
+
271
+ # ----------------------------------------------------------------------------
272
+ # Job that runs the local browser tests against the Angular Github snapshots
273
+ # ----------------------------------------------------------------------------
274
+ snapshot_tests_local_browsers :
275
+ docker : *docker-firefox-image
276
+ resource_class : xlarge
277
+ steps :
278
+ - *checkout_code
279
+ - *restore_cache
280
+ - *yarn_install
281
+
282
+ - run : ./scripts/install-angular-snapshots.sh
283
+ - run : ./scripts/circleci/run-local-browser-tests.sh
205
284
206
285
# ----------------------------------------------------------------------------------------
207
286
# Workflow definitions. A workflow usually groups multiple jobs together. This is useful if
@@ -223,6 +302,7 @@ workflows:
223
302
jobs :
224
303
- tests_local_browsers
225
304
- tests_browserstack
305
+ - tests_saucelabs
226
306
227
307
integration_tests :
228
308
jobs :
@@ -232,7 +312,10 @@ workflows:
232
312
release_output :
233
313
jobs :
234
314
- build_release_packages
235
- - build_demoapp_aot :
315
+ - build_devapp_aot :
316
+ requires :
317
+ - build_release_packages
318
+ - publish_snapshots :
236
319
requires :
237
320
- build_release_packages
238
321
@@ -241,6 +324,25 @@ workflows:
241
324
jobs :
242
325
- lint
243
326
327
+ # Snapshot tests workflow that is scheduled to run all specified jobs at midnight everyday.
328
+ # This workflow runs various jobs against the Angular snapshot builds from Github.
329
+ snapshot_tests :
330
+ jobs :
331
+ # Note that we need additional jobs for the nightly snapshot tests because there is no
332
+ # easy way to detect whether a job runs inside of a cronjob or specific workflow.
333
+ # See: https://circleci.com/ideas/?idea=CCI-I-295
334
+ - snapshot_tests_local_browsers
335
+ triggers :
336
+ - schedule :
337
+ cron : " 0 0 * * *"
338
+ filters :
339
+ branches :
340
+ only :
341
+ # We only want to run the "master" branch against the snapshot builds because
342
+ # it's not guaranteed that older versions of Angular Material always work
343
+ # with the latest Angular version.
344
+ - master
345
+
244
346
# ---------------------------
245
347
# General setup for CircleCI
246
348
# ---------------------------
0 commit comments