Skip to content

Commit 007a768

Browse files
committed
fix(bazel): take into account MODULE.bazel for cache invalidation
This change now considers also `MODULE.bazel` 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 007a768

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

github-actions/bazel/setup/action.yml

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

2323
- name: Setup CI bazelrc config
@@ -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') }}
3636
restore-keys: |
3737
bazel-cache-${{ runner.os }}-

0 commit comments

Comments
 (0)