8
8
# http://yaml-online-parser.appspot.com/
9
9
10
10
var_1 : &docker_image angular/ngcontainer:0.10.0
11
- var_2 : &cache_key v2-ng-mat-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }}-0.7.0
11
+
12
+ # **Note**: When updating the beginning of the cache key, also update the cache key to match
13
+ # the new cache key prefix. This allows us to take advantage of CircleCI's fallback caching.
14
+ # 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-
12
17
13
18
# Settings common to each job
14
- var_3 : &job_defaults
19
+ var_4 : &job_defaults
15
20
working_directory : ~/ng
16
21
docker :
17
22
- image : *docker_image
18
23
19
24
# Job step for checking out the source code from GitHub. This also ensures that the source code
20
25
# is rebased on top of master.
21
- var_4 : &checkout_code
26
+ var_5 : &checkout_code
22
27
checkout :
23
28
# After checkout, rebase on top of master. By default, PRs are not rebased on top of master,
24
29
# which we want. See https://discuss.circleci.com/t/1662
25
30
post : git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge"
26
31
27
32
# Restores the cache that could be available for the current Yarn lock file. The cache usually
28
33
# includes the node modules and the Bazel repository cache.
29
- var_5 : &restore_cache
34
+ var_6 : &restore_cache
30
35
restore_cache :
31
- key : *cache_key
36
+ keys :
37
+ - *cache_key
38
+ - *cache_fallback_key
32
39
33
40
# Saves the cache for the current Yarn lock file. We store the node modules and the Bazel
34
41
# repository cache in order to make subsequent builds faster.
35
- var_6 : &save_cache
42
+ var_7 : &save_cache
36
43
save_cache :
37
44
key : *cache_key
38
45
paths :
39
46
- " node_modules"
40
47
- " ~/bazel_repository_cache"
41
48
42
49
# Decryption token that is used to decode the GCP credentials file in ".circleci/gcp_token".
43
- var_7 : &gcp_decrypt_token "angular"
50
+ var_8 : &gcp_decrypt_token "angular"
44
51
45
52
# Job step that ensures that the node module dependencies are installed and up-to-date. We use
46
53
# Yarn with the frozen lockfile option in order to make sure that lock file and package.json are
47
54
# in sync. Unlike in Travis, we don't need to manually purge the node modules if stale because
48
55
# CircleCI automatically discards the cache if the checksum of the lock file has changed.
49
- var_8 : &yarn_install
56
+ var_9 : &yarn_install
50
57
run : yarn install --frozen-lockfile --non-interactive
51
58
52
59
# Copies the Bazel config which is specifically for CircleCI to a location where Bazel picks it
53
60
# up and merges it with the project-wide bazel configuration (tools/bazel.rc)
54
- var_9 : ©_bazel_config
61
+ var_10 : ©_bazel_config
55
62
# Set up the CircleCI specific bazel configuration.
56
63
run : sudo cp ./.circleci/bazel.rc /etc/bazel.bazelrc
57
64
58
65
# Sets up a different Docker image that includes a moe recent Firefox version which
59
66
# is needed for headless testing.
60
- var_10 : &docker-firefox-image
67
+ var_11 : &docker-firefox-image
61
68
# TODO(devversion): Temporarily use a image that includes Firefox 62 because the
62
69
# ngcontainer image does include an old Firefox version that does not support headless.
63
70
- image : circleci/node:11.4.0-browsers
64
71
65
72
# Attaches the release output which has been stored in the workspace to the current job.
66
73
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
67
- var_11 : &attach_release_output
74
+ var_12 : &attach_release_output
68
75
attach_workspace :
69
76
at : dist/
70
77
71
78
# Branch filter that we can specify for jobs that should only run on publish branches. This filter
72
79
# is used to ensure that not all upstream branches will be published as Github builds
73
80
# (e.g. revert branches, feature branches)
74
- var_12 : &publish_branches_filter
81
+ var_13 : &publish_branches_filter
75
82
branches :
76
83
only :
77
84
- master
@@ -85,15 +92,15 @@ var_12: &publish_branches_filter
85
92
# In order to reduce duplication we use a YAML anchor that just always excludes the "_presubmit"
86
93
# branch. We don't want to run Circle for the temporary "_presubmit" branch which is reserved
87
94
# for the caretaker.
88
- var_13 : &ignore_presubmit_branch_filter
95
+ var_14 : &ignore_presubmit_branch_filter
89
96
branches :
90
97
ignore :
91
98
- " _presubmit"
92
99
- " ivy-2019"
93
100
94
101
# Runs a script that sets up the Bazel remote execution. This will be used by jobs that run
95
102
# Bazel primarily and should benefit from remote caching and execution.
96
- var_14 : &setup_bazel_remote_execution
103
+ var_15 : &setup_bazel_remote_execution
97
104
run :
98
105
name : " Setup bazel RBE remote execution"
99
106
command : ./scripts/circleci/bazel/setup-remote-execution.sh
0 commit comments