From 28a41cde27974983b2686b634efccd487b8b0897 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst Date: Sat, 9 May 2020 13:46:04 +0100 Subject: [PATCH] Add bazel CI caching --- .circleci/config.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3992b28143c..af230099aac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -97,11 +97,15 @@ jobs: working_directory: /src/grpc-gateway steps: - checkout + - restore_cache: + keys: + - v2-bazel-cache-{{ checksum "repositories.bzl" }} + - v2-bazel-cache- - run: name: Create Bazel config file (.bazelrc) command: | cat > .bazelrc << EOF - startup --output_base $HOME/.cache/_grpc_gateway_bazel + startup --output_base /root/.cache/_grpc_gateway_bazel build --test_output errors build --features race # Workaround https://github.com/bazelbuild/bazel/issues/3645 @@ -120,6 +124,10 @@ jobs: command: 'bazel run //:buildifier_check || (echo "ERROR: Bazel files not formatted, please run \`bazel run :buildifier\`" >&2; exit 1)' when: always + - save_cache: + key: v2-bazel-cache-{{ checksum "repositories.bzl" }} + paths: + - /root/.cache/_grpc_gateway_bazel gorelease: environment: ## Split key to avoid github revoking it