Upgrade to Bazel 9 (#3) #7
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
| name: Bazel CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| name: Test & Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: bazel-contrib/setup-bazel@0.14.0 | |
| with: | |
| # Avoid downloading Bazel every time. | |
| bazelisk-cache: true | |
| # Store build cache per workflow. | |
| disk-cache: ${{ github.workflow }} | |
| # Share repository cache between workflows. | |
| repository-cache: true | |
| - name: Bazel Cache | |
| id: bazel-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: "~/.cache/bazel" | |
| key: bazel-cache-${{ runner.os }} | |
| - name: Run Lint | |
| run: bazel test --config=lint //... | |
| build-opt: | |
| name: Test Optimized | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: bazel-contrib/setup-bazel@0.14.0 | |
| with: | |
| # Avoid downloading Bazel every time. | |
| bazelisk-cache: true | |
| # Store build cache per workflow. | |
| disk-cache: ${{ github.workflow }} | |
| # Share repository cache between workflows. | |
| repository-cache: true | |
| - name: Bazel Cache | |
| id: bazel-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: "~/.cache/bazel" | |
| key: bazel-cache-${{ runner.os }} | |
| - name: Run Optimized Tests | |
| run: bazel test --compilation_mode=opt //... | |
| format: | |
| name: Formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: bazel-contrib/setup-bazel@0.14.0 | |
| with: | |
| # Avoid downloading Bazel every time. | |
| bazelisk-cache: true | |
| # Store build cache per workflow. | |
| disk-cache: ${{ github.workflow }} | |
| # Share repository cache between workflows. | |
| repository-cache: true | |
| - name: Check Build Formatting | |
| run: bazel run buildfmt.check | |
| - name: Check Code Formatting | |
| run: bazel test --config=fmt //... |