diff options
Diffstat (limited to '.github/workflows/bazel.yml')
-rw-r--r-- | .github/workflows/bazel.yml | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index d6bbe62..1cdc38c 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -5,29 +5,31 @@ on: pull_request: {} jobs: - build-and-test: - runs-on: ubuntu-latest - + build_and_test_default: + name: bazel.${{ matrix.os }}.${{ matrix.bzlmod && 'bzlmod' || 'no_bzlmod' }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + bzlmod: [false, true] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: mount bazel cache - uses: actions/cache@v1 + uses: actions/cache@v3 + env: + cache-name: bazel-cache with: - path: "/home/runner/.cache/bazel" - key: bazel - - - name: install bazelisk - run: | - curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64" - mkdir -p "${GITHUB_WORKSPACE}/bin/" - mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" - chmod +x "${GITHUB_WORKSPACE}/bin/bazel" + path: "~/.cache/bazel" + key: ${{ env.cache-name }}-${{ matrix.os }}-${{ github.ref }} + restore-keys: | + ${{ env.cache-name }}-${{ matrix.os }}-main - name: build run: | - "${GITHUB_WORKSPACE}/bin/bazel" build //... - + bazel build ${{ matrix.bzlmod && '--enable_bzlmod' || '--noenable_bzlmod' }} //:benchmark //:benchmark_main //test/... + - name: test run: | - "${GITHUB_WORKSPACE}/bin/bazel" test //test/... + bazel test ${{ matrix.bzlmod && '--enable_bzlmod' || '--noenable_bzlmod' }} --test_output=all //test/... |