From a1b61871486d1a0ce258d32689eaa5ba7ef3b6b5 Mon Sep 17 00:00:00 2001 From: Oliver Lee Date: Fri, 28 Jun 2024 14:21:38 -0700 Subject: [PATCH] document minimum Bazel version Change-Id: Id175b8897dd3968dd6bb20908f5783d0a0040412 --- .github/workflows/check.yml | 39 ++++++++++++++++++++++++++++++------- README.md | 5 +---- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 484380a..c7b25a2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -47,26 +47,51 @@ jobs: strategy: fail-fast: false matrix: - include: - - example: default - - example: format-binary - - example: format-config - - example: format-ignore + example: + - default + - format-binary + - format-config + - format-ignore steps: - uses: actions/checkout@v4 - shell: bash run: | cd example/${{ matrix.example }} - bazel build --config=clang-format-fix - bazel build --config=clang-format + bazel-version: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + bazel_version: + - latest + - 7.x + - 6.x + - 5.x + steps: + - uses: actions/checkout@v4 + - shell: bash + env: + USE_BAZEL_VERSION: ${{ matrix.bazel_version }} + run: | + cd example/default + + version=${{ matrix.bazel_version }} + + if [[ "$version" == latest || "$version" < 7 ]]; then + sed -i '/enable_bzlmod/d' .bazelrc + fi + + bazel build --config=clang-format-fix + all: runs-on: ubuntu-latest if: ${{ github.base_ref == 'main' }} needs: - check-format - fix-format + - bazel-version steps: - run: true diff --git a/README.md b/README.md index bf2ffbb..dd89829 100644 --- a/README.md +++ b/README.md @@ -133,8 +133,5 @@ build:clang-format-base --@bazel_clang_format//:ignore=//:clang-format-ignore ## Requirements -- Bazel ??? +- Bazel 5.x - ClangFormat 14 - -I'm not sure what the minimum versions are but please let me know if you are -using a version that doesn't work.