| name: bazel | |
| on: | |
| push: {} | |
| pull_request: {} | |
| env: | |
| CMAKE_GENERATOR: Ninja | |
| permissions: | |
| contents: read | |
| jobs: | |
| build_and_test_default: | |
| name: bazel.${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: mount bazel cache | |
| uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 | |
| env: | |
| cache-name: bazel-cache | |
| with: | |
| path: "~/.cache/bazel" | |
| key: ${{ env.cache-name }}-${{ matrix.os }}-${{ github.ref }} | |
| restore-keys: | | |
| ${{ env.cache-name }}-${{ matrix.os }}-main | |
| - name: build | |
| run: | | |
| bazel build //:benchmark //:benchmark_main //test/... | |
| - name: test | |
| run: | | |
| bazel test --test_output=all //test/... |