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