Skip to content

Commit d753d89

Browse files
committed
fix(bazel): take into account MODULE.bazel.lock for cache invalidation
This change now considers also `MODULE.bazel.lock` as part of the cache key. Also, we which an issue where we had an invalid path in the cache key `\%LocalAppData\%`. These paths are not expanded. See: https://github.com/actions/cache?tab=readme-ov-file#windows-environment-variables
1 parent 72f5a5f commit d753d89

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

github-actions/bazel/setup/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ runs:
1717
with:
1818
path: |
1919
~/.cache/bazelisk
20-
\%LocalAppData\%/bazelisk
21-
key: bazel-version-${{ hashFiles('**/.bazelversion') }}
20+
~/AppData/Local/bazelisk
21+
key: bazel-version-${{ runner.os }}-${{ hashFiles('**/.bazelversion') }}
2222

2323
- name: Setup CI bazelrc config
2424
run: node $GITHUB_ACTION_PATH/setup-ci-bazelrc.mjs
@@ -32,6 +32,6 @@ runs:
3232
# Note: Bazel repository cache is located in system locations and cannot use
3333
# a shared cache between different runner operating systems.
3434
path: '~/.cache/bazel_repo_cache'
35-
key: bazel-cache-${{ runner.os }}-${{ hashFiles('**/WORKSPACE') }}
35+
key: bazel-cache-${{ runner.os }}-${{ hashFiles('**/WORKSPACE') }}-${{ hashFiles('**/MODULE.bazel.lock') }}
3636
restore-keys: |
3737
bazel-cache-${{ runner.os }}-

0 commit comments

Comments
 (0)