Skip to content

Commit 0c5cdbb

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 0c5cdbb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

github-actions/bazel/setup/action.yml

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

2324
- name: Setup CI bazelrc config
2425
run: node $GITHUB_ACTION_PATH/setup-ci-bazelrc.mjs
@@ -32,6 +33,6 @@ runs:
3233
# Note: Bazel repository cache is located in system locations and cannot use
3334
# a shared cache between different runner operating systems.
3435
path: '~/.cache/bazel_repo_cache'
35-
key: bazel-cache-${{ runner.os }}-${{ hashFiles('**/WORKSPACE') }}
36+
key: bazel-cache-${{ runner.os }}-${{ hashFiles('**/WORKSPACE') }}-${{ hashFiles('**/MODULE.bazel.lock') }}
3637
restore-keys: |
3738
bazel-cache-${{ runner.os }}-

0 commit comments

Comments
 (0)