Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bazel CI caching #1314

Merged
merged 2 commits into from
May 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,21 @@ 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
# See https://docs.bazel.build/versions/0.23.0/command-line-reference.html
build --local_ram_resources=HOST_RAM*.5
build --local_ram_resources=3072
build --local_cpu_resources=1
EOF
- run:
name: Check that Bazel BUILD files are up-to-date
Expand All @@ -120,6 +125,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
Expand Down