Use setup-bazel GHA for disk and repository caching #188
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 | |
| 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: | |
| # Use the cached Bazelisk version, or download if not found. | |
| bazelisk-cache: true | |
| # Enable the disk cache and share it across all workflows | |
| # (i.e., across master and pull requests). | |
| # We want all builds to start from a warm cache, and we're not too | |
| # concerend about pull request builds "polluting" master builds. | |
| 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. | |
| # Passing an empty string tells setup-bazel to use the same key | |
| # every time, regardless of any changes to any files. | |
| repository-cache: "" | |
| # This dumps configuration details to the log. | |
| bazelrc: common --announce_rc=yes | |
| # Actual testing. | |
| - name: Bazel Test | |
| run: | | |
| bazelisk test //... |