8
8
# http://yaml-online-parser.appspot.com/
9
9
10
10
var_1 : &docker_image circleci/node:10.16
11
- var_2 : &docker_bazel_image l.gcr.io/google/bazel:0.26.1
12
11
13
12
# **Note**: When updating the beginning of the cache key, also update the cache key to match
14
13
# the new cache key prefix. This allows us to take advantage of CircleCI's fallback caching.
15
14
# Read more here: https://circleci.com/docs/2.0/caching/#restoring-cache.
16
- var_3 : &cache_key v3 -ng-mat-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }}
17
- var_4 : &cache_fallback_key v3 -ng-mat-
15
+ var_2 : &cache_key v4 -ng-mat-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }}
16
+ var_3 : &cache_fallback_key v4 -ng-mat-
18
17
19
18
# Settings common to each job
20
- var_5 : &job_defaults
19
+ var_4 : &job_defaults
21
20
working_directory : ~/ng
22
21
docker :
23
22
- image : *docker_image
24
23
25
24
# Job step for checking out the source code from GitHub. This also ensures that the source code
26
25
# is rebased on top of master.
27
- var_6 : &checkout_code
26
+ var_5 : &checkout_code
28
27
checkout :
29
28
# After checkout, rebase on top of master. By default, PRs are not rebased on top of master,
30
29
# which we want. See https://discuss.circleci.com/t/1662
31
30
post : git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge"
32
31
33
32
# Restores the cache that could be available for the current Yarn lock file. The cache usually
34
33
# includes the node modules and the Bazel repository cache.
35
- var_7 : &restore_cache
34
+ var_6 : &restore_cache
36
35
restore_cache :
37
36
keys :
38
37
- *cache_key
39
38
- *cache_fallback_key
40
39
41
40
# Saves the cache for the current Yarn lock file. We store the node modules and the Bazel
42
41
# repository cache in order to make subsequent builds faster.
43
- var_8 : &save_cache
42
+ var_7 : &save_cache
44
43
save_cache :
45
44
key : *cache_key
46
45
paths :
47
46
- " node_modules"
48
47
- " ~/bazel_repository_cache"
49
48
50
49
# Decryption token that is used to decode the GCP credentials file in ".circleci/gcp_token".
51
- var_9 : &gcp_decrypt_token "angular"
50
+ var_8 : &gcp_decrypt_token "angular"
52
51
53
52
# Job step that ensures that the node module dependencies are installed and up-to-date. We use
54
53
# Yarn with the frozen lockfile option in order to make sure that lock file and package.json are
55
54
# in sync. Unlike in Travis, we don't need to manually purge the node modules if stale because
56
55
# CircleCI automatically discards the cache if the checksum of the lock file has changed.
57
- var_10 : &yarn_install
56
+ var_9 : &yarn_install
58
57
run :
59
58
name : " Installing project dependencies"
60
59
command : yarn install --frozen-lockfile --non-interactive
61
60
62
61
# Anchor that can be used to download and install Yarn globally in the bash environment.
63
- var_11 : &yarn_download
62
+ var_10 : &yarn_download
64
63
run :
65
64
name : " Downloading and installing Yarn"
66
65
command : |
67
66
touch $BASH_ENV
68
67
curl -o- -L https://yarnpkg.com/install.sh | PROFILE=$BASH_ENV bash -s -- --version "1.16.0"
69
68
70
69
# Sets up the Bazel config which is specific for CircleCI builds.
71
- var_12 : &setup_bazel_ci_config
70
+ var_11 : &setup_bazel_ci_config
72
71
run :
73
72
name : " Setting up Bazel configuration for CI"
74
73
command : |
75
74
echo "import %workspace%/.circleci/bazel.rc" >> ./.bazelrc
76
75
77
76
# Sets up a different Docker image that includes a moe recent Firefox version which
78
77
# is needed for headless testing.
79
- var_13 : &docker-firefox-image
78
+ var_12 : &docker-firefox-image
80
79
# TODO(devversion): Temporarily use a image that includes Firefox 62 because the
81
80
# ngcontainer image does include an old Firefox version that does not support headless.
82
81
- image : circleci/node:11.4.0-browsers
83
82
84
83
# Attaches the release output which has been stored in the workspace to the current job.
85
84
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
86
- var_14 : &attach_release_output
85
+ var_13 : &attach_release_output
87
86
attach_workspace :
88
87
at : dist/
89
88
90
89
# Branch filter that we can specify for jobs that should only run on publish branches. This filter
91
90
# is used to ensure that not all upstream branches will be published as Github builds
92
91
# (e.g. revert branches, feature branches)
93
- var_15 : &publish_branches_filter
92
+ var_14 : &publish_branches_filter
94
93
branches :
95
94
only :
96
95
- master
@@ -104,15 +103,15 @@ var_15: &publish_branches_filter
104
103
# In order to reduce duplication we use a YAML anchor that just always excludes the "_presubmit"
105
104
# branch. We don't want to run Circle for the temporary "_presubmit" branch which is reserved
106
105
# for the caretaker.
107
- var_16 : &ignore_presubmit_branch_filter
106
+ var_15 : &ignore_presubmit_branch_filter
108
107
branches :
109
108
ignore :
110
109
- " _presubmit"
111
110
- " ivy-2019"
112
111
113
112
# Runs a script that sets up the Bazel remote execution. This will be used by jobs that run
114
113
# Bazel primarily and should benefit from remote caching and execution.
115
- var_17 : &setup_bazel_remote_execution
114
+ var_16 : &setup_bazel_remote_execution
116
115
run :
117
116
name : " Setup bazel RBE remote execution"
118
117
command : ./scripts/circleci/bazel/setup-remote-execution.sh
@@ -132,8 +131,7 @@ jobs:
132
131
# Build and test job that uses Bazel.
133
132
# -----------------------------------
134
133
bazel_build_test :
135
- docker :
136
- - image : *docker_bazel_image
134
+ << : *job_defaults
137
135
resource_class : xlarge
138
136
environment :
139
137
GCP_DECRYPT_TOKEN : *gcp_decrypt_token
@@ -142,17 +140,18 @@ jobs:
142
140
- *restore_cache
143
141
- *setup_bazel_ci_config
144
142
- *setup_bazel_remote_execution
143
+ - *yarn_download
144
+ - *yarn_install
145
145
146
- - run : bazel build src/... --build_tag_filters=-docs-package
147
- - run : bazel test src/... --build_tag_filters=-docs-package --test_tag_filters=-e2e
146
+ - run : yarn bazel build src/... --build_tag_filters=-docs-package
147
+ - run : yarn bazel test src/... --build_tag_filters=-docs-package --test_tag_filters=-e2e
148
148
149
149
# --------------------------------------------------------------------------------------------
150
150
# Job that runs ts-api-guardian against our API goldens in "tools/public_api_guard".
151
151
# This job fails whenever an API has been updated but not explicitly approved through goldens.
152
152
# --------------------------------------------------------------------------------------------
153
153
api_golden_checks :
154
- docker :
155
- - image : *docker_bazel_image
154
+ << : *job_defaults
156
155
resource_class : xlarge
157
156
environment :
158
157
GCP_DECRYPT_TOKEN : *gcp_decrypt_token
@@ -161,15 +160,16 @@ jobs:
161
160
- *restore_cache
162
161
- *setup_bazel_ci_config
163
162
- *setup_bazel_remote_execution
163
+ - *yarn_download
164
+ - *yarn_install
164
165
165
- - run : bazel test tools/public_api_guard/...
166
+ - run : yarn bazel test tools/public_api_guard/...
166
167
167
168
# -----------------------------------------------------------------
168
169
# Job that runs the e2e tests with Protractor and Chromium headless
169
170
# -----------------------------------------------------------------
170
171
e2e_tests :
171
- docker :
172
- - image : *docker_bazel_image
172
+ << : *job_defaults
173
173
resource_class : xlarge
174
174
environment :
175
175
GCP_DECRYPT_TOKEN : *gcp_decrypt_token
@@ -178,8 +178,10 @@ jobs:
178
178
- *restore_cache
179
179
- *setup_bazel_ci_config
180
180
- *setup_bazel_remote_execution
181
+ - *yarn_download
182
+ - *yarn_install
181
183
182
- - run : bazel test src/... --test_tag_filters=e2e
184
+ - run : yarn bazel test src/... --test_tag_filters=e2e
183
185
184
186
# ------------------------------------------------------------------------------------------
185
187
# Job that runs the unit tests on locally installed browsers (Chrome and Firefox headless).
@@ -330,8 +332,7 @@ jobs:
330
332
# Job that publishes the build snapshots
331
333
# ----------------------------------------
332
334
publish_snapshots :
333
- docker :
334
- - image : *docker_bazel_image
335
+ << : *job_defaults
335
336
resource_class : xlarge
336
337
environment :
337
338
GCP_DECRYPT_TOKEN : *gcp_decrypt_token
@@ -341,6 +342,8 @@ jobs:
341
342
- *attach_release_output
342
343
- *setup_bazel_ci_config
343
344
- *setup_bazel_remote_execution
345
+ - *yarn_download
346
+ - *yarn_install
344
347
345
348
# CircleCI has a config setting to enforce SSH for all github connections.
346
349
# This is not compatible with our mechanism of using a Personal Access Token
@@ -349,7 +352,7 @@ jobs:
349
352
350
353
# TODO(devversion): Ideally the "build_release_packages" job should build all packages with
351
354
# Bazel, but for now we mix up the Gulp and bazel setup, so we need to build the package here.
352
- - run : bazel build src/material-examples:npm_package --config=release
355
+ - run : yarn bazel build src/material-examples:npm_package --config=release
353
356
354
357
- run : ./scripts/circleci/publish-snapshots.sh
355
358
@@ -365,8 +368,11 @@ jobs:
365
368
- *restore_cache
366
369
- *yarn_download
367
370
368
- - run : python ./scripts/circleci/setup-angular-snapshots.py --tag master
369
- - *yarn_install
371
+ - run : node ./scripts/circleci/setup-angular-snapshots.js --tag master
372
+ # Install yarn dependencies after the package.json has been updated. Note that
373
+ # we can't use frozen-lockfile since the setup snapshots script does not update
374
+ # the lock file.
375
+ - run : yarn install --non-interactive
370
376
- run : ./scripts/circleci/run-local-browser-tests.sh
371
377
372
378
@@ -375,8 +381,7 @@ jobs:
375
381
# specified in the project dev dependencies.
376
382
# ----------------------------------------------------------------------------
377
383
ivy_test :
378
- docker :
379
- - image : *docker_bazel_image
384
+ << : *job_defaults
380
385
resource_class : xlarge
381
386
environment :
382
387
GCP_DECRYPT_TOKEN : *gcp_decrypt_token
@@ -385,28 +390,29 @@ jobs:
385
390
- *restore_cache
386
391
- *setup_bazel_ci_config
387
392
- *setup_bazel_remote_execution
393
+ - *yarn_download
394
+ - *yarn_install
388
395
389
396
# Setup Angular ivy snapshots built with ngtsc but locked to a specific tag. We
390
397
# cannot determine the tag automatically based on the Angular version specified in
391
398
# the "package.json" because the SHA is not known for the given release. Nor can
392
399
# we use ngcc to apply the ivy switches because ngcc currently does not handle the
393
400
# UMD format which is used by Bazel when running tests. UMD processing is in
394
401
# progress and tracked with FW-85.
395
- - run : python ./scripts/circleci/setup-angular-snapshots.py --tag 8.1.0-next.1-ivy-aot+82e0b4a
402
+ - run : node ./scripts/circleci/setup-angular-snapshots.js --tag 8.1.0-next.1-ivy-aot+82e0b4a
396
403
# Disable type checking when building with Ivy. This is necessary because
397
404
# type checking is not complete yet and can incorrectly break compilation.
398
405
# Issue is tracked with FW-1004.
399
406
- run : sed -i "s/\(_ENABLE_NG_TYPE_CHECKING = \)True/\1False/g" tools/defaults.bzl
400
407
# Run project tests with ngtsc and the Ivy Angular packages.
401
- - run : bazel build src/... --build_tag_filters=-docs-package --define=compile=aot
402
- - run : bazel test src/... --build_tag_filters=-docs-package --define=compile=aot --test_tag_filters=-e2e
408
+ - run : yarn bazel build src/... --build_tag_filters=-docs-package --define=compile=aot
409
+ - run : yarn bazel test src/... --build_tag_filters=-docs-package --define=compile=aot --test_tag_filters=-e2e
403
410
404
411
# ----------------------------------------------------------------------------
405
412
# Job that runs all Bazel tests against Ivy from angular/angular#master.
406
413
# ----------------------------------------------------------------------------
407
414
ivy_snapshot_test_cronjob :
408
- docker :
409
- - image : *docker_bazel_image
415
+ << : *job_defaults
410
416
resource_class : xlarge
411
417
environment :
412
418
GCP_DECRYPT_TOKEN : *gcp_decrypt_token
@@ -415,16 +421,18 @@ jobs:
415
421
- *restore_cache
416
422
- *setup_bazel_ci_config
417
423
- *setup_bazel_remote_execution
424
+ - *yarn_download
425
+ - *yarn_install
418
426
419
427
# Setup Angular ivy snapshots built with ngtsc.
420
- - run : python ./scripts/circleci/setup-angular-snapshots.py --tag master-ivy-aot
428
+ - run : node ./scripts/circleci/setup-angular-snapshots.js --tag master-ivy-aot
421
429
# Disable type checking when building with Ivy. This is necessary because
422
430
# type checking is not complete yet and can incorrectly break compilation.
423
431
# Issue is tracked with FW-1004.
424
432
- run : sed -i "s/\(_ENABLE_NG_TYPE_CHECKING = \)True/\1False/g" tools/defaults.bzl
425
433
# Run project tests with ngtsc and the Ivy Angular packages.
426
- - run : bazel build src/... --build_tag_filters=-docs-package --define=compile=aot
427
- - run : bazel test src/... --build_tag_filters=-docs-package --define=compile=aot --test_tag_filters=-e2e
434
+ - run : yarn bazel build src/... --build_tag_filters=-docs-package --define=compile=aot
435
+ - run : yarn bazel test src/... --build_tag_filters=-docs-package --define=compile=aot --test_tag_filters=-e2e
428
436
429
437
# ----------------------------------------------------------------------------------------
430
438
# Workflow definitions. A workflow usually groups multiple jobs together. This is useful if
0 commit comments