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

build: fix ci build caching #17

Merged
merged 1 commit into from
Jan 22, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build --announce_rc
# though it makes the log noisier.
test --test_output=errors
# This directory is configured in GitHub actions to be persisted between runs.
build --disk_cache=$HOME/.cache/bazel
build --repository_cache=$HOME/.cache/bazel-repo
build --disk_cache=~/.cache/bazel
build --repository_cache=~/.cache/bazel-repo
# Allows tests to run bazelisk-in-bazel, since this is the cache folder used
test --test_env=XDG_CACHE_HOME
14 changes: 6 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Mount bazel action cache
- name: Mount bazel caches
uses: actions/cache@v2
with:
path: "~/.cache/bazel"
key: bazel
- name: Mount bazel repo cache
uses: actions/cache@v2
with:
path: "~/.cache/bazel-repo"
key: bazel-repo
path: |
"~/.cache/bazel"
"~/.cache/bazel-repo"
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm. why the cache key? are we concerned about hitting the max size for the underlying storage? where are these caches stored actually?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restore-keys: bazel-cache-
- name: bazel test //...
env:
# Bazelisk will download bazel to here, ensure it is cached between runs.
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Mount bazel caches
uses: actions/cache@v2
with:
path: |
"~/.cache/bazel"
"~/.cache/bazel-repo"
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }}
restore-keys: bazel-cache-
- name: bazel test //...
env:
# Bazelisk will download bazel to here
Expand Down