diff --git a/.bazelrc b/.bazelrc index 424fd1c3..c1cf743a 100644 --- a/.bazelrc +++ b/.bazelrc @@ -3,7 +3,6 @@ build --cxxopt=-std=c++20 build --incompatible_strict_action_env build --keep_going common --experimental_allow_unresolved_symlinks # Only required for Bazel 5 -common --noenable_bzlmod # This line is automatically removed in CI for Bazel 5 test --announce_rc test --keep_going test --spawn_strategy=sandboxed diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4d680bbb..ff8ec39c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,22 +17,26 @@ jobs: matrix: bazel-version: ["5.x", "6.x", "7.x"] os: ["ubuntu-latest", "macos-latest"] + bzlmod: ["--enable_bzlmod", "--noenable_bzlmod"] + exclude: + # Don't expect Bazel compatibility issues depending on OS, so speed this up + - bazel-version: "5.x" + os: "macos-latest" + - bazel-version: "6.x" + os: "macos-latest" + # No Bzlmod with Bazel 5 + - bazel-version: "5.x" + bzlmod: "--enable_bzlmod" steps: - uses: actions/checkout@v4 - uses: actions/cache@v3 with: path: "~/.cache/bazelisk\n~/.cache/bazel\n" - key: bazel-${{ matrix.bazel-version }}-cache-${{ github.run_id }} - restore-keys: bazel-${{ matrix.bazel-version }}-cache- + key: bazel-${{ matrix.bazel-version }}-${{ matrix.os }}-${{ matrix.bzlmod }}-cache-${{ github.run_id }} + restore-keys: bazel-${{ matrix.bazel-version }}-${{ matrix.os }}-${{ matrix.bzlmod }}-cache- - - run: sed -i.bak '/enable_bzlmod/d' .bazelrc && rm .bazelrc.bak - if: ${{ matrix.bazel-version == '5.x' }} - - - run: bazel test //... - - - run: bazel test --enable_bzlmod //... - if: ${{ matrix.bazel-version != '5.x' }} + - run: bazel ${{ matrix.bzlmod}} test //... lint: runs-on: ubuntu-latest