From dd9735de4d46de86f018225c667ad7deec4452f8 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Tue, 4 Mar 2025 20:57:41 +0100 Subject: [PATCH] Add BCR specific testing to CI. (#107) --- .github/workflows/main.yml | 20 ++++++++++++++++++++ .github/workflows/test.yml | 15 +++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86d471b..0f5c045 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,3 +58,23 @@ jobs: compiler: ${{ matrix.compiler }} llvm_version: ${{ matrix.llvm_version }} bazel_config: ${{ matrix.bazel_config }} + + test-bcr: + needs: [pre-commit, test-gcc, test-clang] + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + bazel_mode: [bzlmod] + compiler: [clang] + llvm_version: [19.1.6] + bazel_config: [opt] + module_versions: [0.4.2] + + uses: ./.github/workflows/test.yml + with: + continue-on-error: true + os: ${{ matrix.os }} + bazel_mode: ${{ matrix.bazel_mode }} + compiler: ${{ matrix.compiler }} + llvm_version: ${{ matrix.llvm_version }} + bazel_config: ${{ matrix.bazel_config }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 353ae85..50c42d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,6 +31,10 @@ on: description: 'The way how Bazel should operate compilation and tests, one of (asan, fastbuild, opt).' type: string default: opt + module_version: + description: 'Version string for the MODULE.$ver.bazel to be copied from the bzlmod directory.' + type: string + default: '' jobs: test: @@ -47,11 +51,11 @@ jobs: - uses: actions/cache@v4 with: path: "~/.cache/bazel" - key: ${{ inputs.os }}-${{ inputs.bazel_mode }}${{ inputs.compiler }}${{ inputs.llvm_version }}${{ inputs.gcc_version }}${{ inputs.bazel_config }}-${{github.ref}}-${{ github.sha }} + key: ${{ inputs.os }}-${{ inputs.bazel_mode }}${{ inputs.compiler }}${{ inputs.llvm_version }}${{ inputs.gcc_version }}${{ inputs.bazel_config }}${{ inputs.module_version }}-${{github.ref}}-${{ github.sha }} restore-keys: | - ${{ inputs.os }}-${{ inputs.bazel_mode }}${{ inputs.compiler }}${{ inputs.llvm_version }}${{ inputs.gcc_version }}${{ inputs.bazel_config }}-${{github.ref}}- - ${{ inputs.os }}-${{ inputs.bazel_mode }}${{ inputs.compiler }}${{ inputs.llvm_version }}${{ inputs.gcc_version }}${{ inputs.bazel_config }}-refs/heads/main- - ${{ inputs.os }}-${{ inputs.bazel_mode }}${{ inputs.compiler }}${{ inputs.llvm_version }}${{ inputs.gcc_version }}${{ inputs.bazel_config }}- + ${{ inputs.os }}-${{ inputs.bazel_mode }}${{ inputs.compiler }}${{ inputs.llvm_version }}${{ inputs.gcc_version }}${{ inputs.bazel_config }}${{ inputs.module_version }}-${{github.ref}}- + ${{ inputs.os }}-${{ inputs.bazel_mode }}${{ inputs.compiler }}${{ inputs.llvm_version }}${{ inputs.gcc_version }}${{ inputs.bazel_config }}${{ inputs.module_version }}-refs/heads/main- + ${{ inputs.os }}-${{ inputs.bazel_mode }}${{ inputs.compiler }}${{ inputs.llvm_version }}${{ inputs.gcc_version }}${{ inputs.bazel_config }}${{ inputs.module_version }}- - run: | declare -a BAZEL_INIT=() declare -a BAZEL_ARGS=() @@ -90,4 +94,7 @@ jobs: else echo "ERROR: Matrix/Input var 'bazel_config' must be one of [asan, fastbuild, opt]." fi + if [ -n "${{ inputs.module_version }}" ]; then + cp "bazelmod/MODULE.${{ inputs.module_version }}.bazel" MODULE.bazel + fi bazel "${BAZEL_INIT[@]}" test "${BAZEL_ARGS[@]}" //...