From 913d08e0f2f1c0ab5e0c287ca2f3554f0b3aeb62 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 3 Oct 2018 00:30:05 +0200 Subject: [PATCH] build: cache bazel managed node modules (#13352) * build: cache bazel managed node modules * Since we recently switched to Bazel managed dependencies, we need to cache the repository cache of our workspace because otherwise CircleCI will analyze the Bazel managed dependencies for each run (which takes multiple minutes) * Improve comment --- .circleci/bazel.rc | 7 +++++++ .circleci/config.yml | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 .circleci/bazel.rc diff --git a/.circleci/bazel.rc b/.circleci/bazel.rc new file mode 100644 index 00000000000..327a880860d --- /dev/null +++ b/.circleci/bazel.rc @@ -0,0 +1,7 @@ +# Bazel configuration that will be copied to /etc/bazel.bazelrc in CircleCI containers. +# This allows us adding specific configuration flags for builds within CircleCI. +# See more: https://docs.bazel.build/versions/master/user-manual.html#where-are-the-bazelrc-files + +# 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 --experimental_repository_cache=/home/circleci/bazel_repository_cache diff --git a/.circleci/config.yml b/.circleci/config.yml index dfbaeeaa411..1304206a87f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,6 +44,8 @@ jobs: <<: *post_checkout - restore_cache: key: *cache_key + # Set up the CircleCI specific bazel configuration. + - run: sudo cp ./.circleci/bazel.rc /etc/bazel.bazelrc # TODO(jelbourn): Update this command to run all tests if the Bazel issues have been fixed. - run: bazel test src/{cdk,lib}/schematics:unit_tests @@ -52,6 +54,7 @@ jobs: key: *cache_key paths: - "node_modules" + - "~/bazel_repository_cache" workflows: version: 2