Skip to content

ci: cache Bazel builds (#15) #95

ci: cache Bazel builds (#15)

ci: cache Bazel builds (#15) #95

Workflow file for this run

name: presubmit
on:
push:
branches:
- main
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
presubmit:
strategy:
matrix:
bazel:
- 7.*
- 8.*
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
repository-cache: true
disk-cache: presubmit-${{ matrix.bazel }}
cache-save: ${{ github.event_name != 'pull_request' }}
- name: Check dependencies and format
run: scripts/update-dependencies && scripts/format && { [[ -z "$(git status --porcelain)" ]] || exit 1; }
- name: bazel test //...
env:
# Bazelisk will download bazel to here, ensure it is cached within tests.
XDG_CACHE_HOME: /home/runner/.cache/bazel-repo
USE_BAZEL_VERSION: ${{ matrix.bazel }}
run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //...