From c080b52f95abfa48eb9ea684a09e38ec3d57a767 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Mon, 2 Dec 2024 16:31:04 -0800 Subject: [PATCH] .github/workflows: Split Bazel into two jobs The two Bazel versions are completely separate; no need to run them serially. --- .github/workflows/testing.yml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8c639cf14e..d68d85eb0c 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -77,8 +77,16 @@ jobs: bazel: runs-on: ubuntu-latest + strategy: + matrix: + include: + # Test with and without bzlmod. Bazel 6 doesn't support bzlmod, so use Bazel 7 instead + - bazel: 6.0.0 + bzlmod: false + - bazel: 7.0.0 + bzlmod: true env: - USE_BAZEL_VERSION: 6.0.0 + USE_BAZEL_VERSION: ${{ matrix.bazel }} steps: - uses: actions/checkout@v4 @@ -97,19 +105,8 @@ jobs: key: ${{ runner.os }}-bazel-${{ env.USE_BAZEL_VERSION }}-${{ hashFiles('WORKSPACE', 'repositories.bzl') }} - name: Run bazel build - run: bazelisk build //... --enable_bzlmod=false + run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }} - name: Run example bazel build - run: bazelisk build //... --enable_bzlmod=false - working-directory: ./examples - - - name: Run bazel build (bzlmod) - env: - USE_BAZEL_VERSION: 7.0.0 - run: bazelisk build //... --enable_bzlmod=true - - - name: Run example bazel build (bzlmod) - env: - USE_BAZEL_VERSION: 7.0.0 - run: bazelisk build //... --enable_bzlmod=true + run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }} working-directory: ./examples