diff --git a/.circleci/bazel.rc b/.circleci/bazel.rc index 754a970122..315c2667d0 100644 --- a/.circleci/bazel.rc +++ b/.circleci/bazel.rc @@ -2,6 +2,10 @@ # We do this by copying this file to /etc/bazel.bazelrc at the start of the build. # See documentation in /docs/BAZEL.md +# Save downloaded repositories in a location that can be cached by CircleCI. This helps us +# speeding up the analysis time significantly with Bazel managed node dependencies on the CI. +build --repository_cache=/home/circleci/bazel_repository_cache + # Don't be spammy in the logs # TODO(gmagolan): Hide progress again once build performance improves # Presently, CircleCI can timeout during bazel test ... with the following diff --git a/.circleci/config.yml b/.circleci/config.yml index f4f1be7bef..23517ec50a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,8 +20,10 @@ var_2: &browsers_docker_image circleci/node:10.12-browsers # We don't want to include the current branch name in the cache key because that would prevent # PRs from being able to restore the cache since the branch names are always different for PRs. # The cache key should only consist of dynamic values that change whenever something in the -# cache changes. (e.g. Yarn lock file changes --> cached "node_modules" are different). -var_3: &cache_key v2-angular-{{ checksum "yarn.lock" }}-node-10.12 +# cache changes. For example: +# 1) yarn lock file changes --> cached "node_modules" are different. +# 2) bazel repository definitions change --> cached bazel repositories are different. +var_3: &cache_key v2-angular-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-node-10.12 # Define common ENV vars var_4: &define_env_vars