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