GitHub workflows should use more restrictive bazel cache line
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
Currently we use `{{ github.sha1 }}` as the main cache line for storing bazel cache in GitHub actions.
This effectively cause a new cache to be created on each commit eating precious cache quota and potentially slowing down the cache action post run step (as it need to upload a brand new cache).
https://github.com/actions/cache/blob/main/examples.md#---bazel suggests to use:
```
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
```
We could use a derivative of this, that also include `dependency_support` bzl files to only re-upload a new cache when the project dependencies change.
This would have the side effect of *not* refreshing the cache of the main XLS build anymore, but that's not where we spend the most of our build time anyway.
Contributor guide
Assessment
This issue has not been assessed yet.