Use setup-bazel GHA for disk and repository caching #178
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-License-Identifier: BSD-3-Clause | |
| name: Continuous Integration | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| bazel_test: | |
| runs-on: ubuntu-latest | |
| env: | |
| # This is where bazelisk caches its downloads of Bazel. | |
| BAZELISK_HOME: /home/runner/.cache/bazel_ci/bazelisk | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Ubuntu dependencies | |
| run: .github/ci_setup.bash | |
| # Use setup-bazel for caching | |
| - uses: bazel-contrib/setup-bazel@0.15.0 | |
| with: | |
| # Store build cache globally | |
| disk-cache: true | |
| # Share repository cache globally as well. If repository-cache is set to true, | |
| # it uses the hash of a few bazel files as the key for the cache. You can set | |
| # your own list of files to use to calculate the key by passing them below. | |
| # For now, we pass an empty string. This tells setup-bazel to use the same key | |
| # every time, regardless of any changes to any files. | |
| repository-cache: "" | |
| - name: Report cache sizes | |
| run: | | |
| du -ms ~/.cache/* || true | |
| # Actual testing. | |
| - name: Bazel Test | |
| run: | | |
| ln -s .github/ci.bazelrc user.bazelrc | |
| bazelisk test //... |