From 227c93f5bab4c71897424632e51583df8a664a03 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Thu, 4 Jun 2026 14:48:40 +0200 Subject: [PATCH 01/12] Refactor CI to mimic the way we defined running our tests --- .../rhel9/action.yaml | 2 +- .../ubuntu/action.yaml | 2 +- .github/workflows/foss.yaml | 100 ------------------ .github/workflows/lint.yaml | 44 -------- .../workflows/{unit_test.yaml => test.yaml} | 41 +++++-- 5 files changed, 33 insertions(+), 156 deletions(-) delete mode 100644 .github/workflows/foss.yaml delete mode 100644 .github/workflows/lint.yaml rename .github/workflows/{unit_test.yaml => test.yaml} (76%) diff --git a/.github/platform_environment_setup/rhel9/action.yaml b/.github/platform_environment_setup/rhel9/action.yaml index 5ca4ec2f..49e9d610 100644 --- a/.github/platform_environment_setup/rhel9/action.yaml +++ b/.github/platform_environment_setup/rhel9/action.yaml @@ -33,7 +33,7 @@ runs: shell: bash - name: Install CodeChecker - run: pip3 install codechecker + run: pip3 install codechecker pylint pytest shell: bash - name: Setup Bazel diff --git a/.github/platform_environment_setup/ubuntu/action.yaml b/.github/platform_environment_setup/ubuntu/action.yaml index 543ff439..710c3496 100644 --- a/.github/platform_environment_setup/ubuntu/action.yaml +++ b/.github/platform_environment_setup/ubuntu/action.yaml @@ -58,5 +58,5 @@ runs: shell: bash - name: Install CodeChecker - run: pip3 install codechecker + run: pip3 install codechecker pylint pytest shell: bash diff --git a/.github/workflows/foss.yaml b/.github/workflows/foss.yaml deleted file mode 100644 index 4be0ee2c..00000000 --- a/.github/workflows/foss.yaml +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright 2023 Ericsson AB -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: codechecker-bazel-foss-tests - -# Triggers the workflow on push or pull request events. -on: - push: - paths-ignore: - - "**/*.md" - - "README*" - - "LICENSE" - pull_request: - paths-ignore: - - "**/*.md" - - "README*" - - "LICENSE" - -permissions: read-all - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - # TODO: Parallelize the running of projects - load_versions: - name: "Load bazel versions for FOSS tests" - runs-on: ubuntu-24.04 - outputs: - bazel_version: ${{ steps.generate_matrix.outputs.matrix_json }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Load versions - id: generate_matrix - run: | - JSON=$(jq -c . ./.github/bazel_version.json) - echo "matrix_json=$JSON" >> $GITHUB_OUTPUT - - foss_ubuntu_test: - name: "Test rules on FOSS projects Bazel: ${{ matrix.bazel_version }} (ubuntu)" - runs-on: ubuntu-24.04 - needs: load_versions - strategy: - fail-fast: false - matrix: - bazel_version: ${{ fromJson(needs.load_versions.outputs.bazel_version) }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup environment - uses: ./.github/platform_environment_setup/ubuntu - - - name: Set Bazel version - run: echo ${{ matrix.bazel_version }} >> .bazelversion - - - name: Run Test On Opensource Projects - working-directory: test - run: python3 -m unittest foss/test_foss.py -vvv - - foss_rhel_test: - name: "Test rules on FOSS projects Bazel ${{ matrix.bazel_version }} (RHEL)" - runs-on: ubuntu-24.04 - container: - image: redhat/ubi9:latest - options: --init - needs: load_versions - strategy: - fail-fast: false - matrix: - bazel_version: ${{ fromJson(needs.load_versions.outputs.bazel_version) }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup environment - uses: ./.github/platform_environment_setup/rhel9 - - - name: Set Bazel version - run: echo ${{ matrix.bazel_version }} >> .bazelversion - - - name: Run Test On Opensource Projects - working-directory: test - run: runuser -u test -- python3 -m unittest foss/test_foss.py -vvv diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index 03640ad6..00000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: Linters - -on: - push: - paths-ignore: - - "**/*.md" - - "README*" - - "LICENSE" - pull_request: - paths-ignore: - - "**/*.md" - - "README*" - - "LICENSE" - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.15.0 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pylint - echo "6.5.0" > .bazelversion - - - name: Analysing the code with pylint - run: pylint . - - - name: Analyzing the code with Buildifier - run: | - bazel test //:buildifier --test_output=all - - # TODO: Add more linters here diff --git a/.github/workflows/unit_test.yaml b/.github/workflows/test.yaml similarity index 76% rename from .github/workflows/unit_test.yaml rename to .github/workflows/test.yaml index d463856f..133eda9a 100644 --- a/.github/workflows/unit_test.yaml +++ b/.github/workflows/test.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: codechecker-bazel-unit-tests +name: rules-codechecker-tests # Triggers the workflow on push or pull request events. on: @@ -36,7 +36,7 @@ concurrency: jobs: load_versions: - name: "Load bazel versions for Unit tests" + name: "Load bazel versions for tests" runs-on: ubuntu-24.04 outputs: bazel_version: ${{ steps.generate_matrix.outputs.matrix_json }} @@ -51,7 +51,7 @@ jobs: echo "matrix_json=$JSON" >> $GITHUB_OUTPUT ubuntu_test: - name: "Unit tests: Bazel ${{ matrix.bazel_version }} (Ubuntu)" + name: "Tests: Bazel ${{ matrix.bazel_version }} (Ubuntu)" runs-on: ubuntu-24.04 needs: load_versions strategy: @@ -79,13 +79,23 @@ jobs: "Be sure to double check during debugging." CodeChecker analyzers - - name: Run tests + - name: Run lint tests run: | - cd test - python3 -m unittest discover unit -vvv + pylint . + bazel test //:buildifier --test_output=all + + # Splitting unit and FOSS tests, since unit tests fail faster. + # Therefore: less wasted CI runtime. + - name: Run unit tests + run: | + bazel test //... + pytest test/unit + + - name: Run Open Source tests + run: pytest test/foss rhel9_test: - name: "Unit tests: Bazel ${{ matrix.bazel_version }} (RHEL9)" + name: "Tests: Bazel ${{ matrix.bazel_version }} (RHEL9)" runs-on: ubuntu-24.04 container: image: redhat/ubi9:latest @@ -116,7 +126,18 @@ jobs: "Be sure to double check during debugging." CodeChecker analyzers - - name: Run tests + - name: Run lint tests run: | - cd test - runuser -u test -- python3 -m unittest discover unit -vvv + pylint . + bazel test //:buildifier --test_output=all + + # Splitting unit and FOSS tests, since unit tests fail faster. + # Therefore: less wasted CI runtime. + - name: Run unit tests + run: | + bazel test //... + pytest test/unit + + - name: Run Open Source tests + run: pytest test/foss + From 5eace99b95d3910d98b493cc00dbf818e8507e08 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Fri, 5 Jun 2026 13:58:34 +0200 Subject: [PATCH 02/12] Bumb pylint version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f17bdabf..f6a1c11c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ pytest -pylint +pylint >= 4.0.0 codechecker >= 6.27.3 From 095e7036e20ab0e8c2d672bb165eb3223f0d11fa Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Fri, 5 Jun 2026 14:22:26 +0200 Subject: [PATCH 03/12] Use micromamba for dependency handling --- .ci/micromamba/ci.yaml | 14 +++++ .../rhel9/action.yaml | 59 ------------------ .../ubuntu/action.yaml | 62 ------------------- .github/workflows/test.yaml | 50 ++++++++++++--- 4 files changed, 57 insertions(+), 128 deletions(-) create mode 100644 .ci/micromamba/ci.yaml delete mode 100644 .github/platform_environment_setup/rhel9/action.yaml delete mode 100644 .github/platform_environment_setup/ubuntu/action.yaml diff --git a/.ci/micromamba/ci.yaml b/.ci/micromamba/ci.yaml new file mode 100644 index 00000000..3c039c41 --- /dev/null +++ b/.ci/micromamba/ci.yaml @@ -0,0 +1,14 @@ +name: dev +channels: + - conda-forge +dependencies: + - python=3.11 + - pytest + - pylint + - pycodestyle + - buildifier + - clang=21 + - clang-tools=21 + - bazel + - pip: + - codechecker==6.27.3 diff --git a/.github/platform_environment_setup/rhel9/action.yaml b/.github/platform_environment_setup/rhel9/action.yaml deleted file mode 100644 index 49e9d610..00000000 --- a/.github/platform_environment_setup/rhel9/action.yaml +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2023 Ericsson AB -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 'Setup environment for redhat9' -description: 'Sets up analyzers, CodeChecker and Bazel for rhel9 CI runner' -runs: - using: "composite" - steps: - - name: Install CodeChecker analyzers - run: | - dnf update -y && \ - dnf install -y \ - llvm-toolset \ - clang-tools-extra \ - wget \ - git \ - python3 \ - python3-pip \ - gcc \ - g++ \ - scl-utils \ - shell: bash - - - name: Install CodeChecker - run: pip3 install codechecker pylint pytest - shell: bash - - - name: Setup Bazel - run: | - VERSION=1.26.0; \ - wget "https://github.com/bazelbuild/bazelisk/releases/download/v$VERSION/bazelisk-linux-amd64" && \ - chmod +x bazelisk-linux-amd64 && \ - mv bazelisk-linux-amd64 /usr/local/bin/bazel - shell: bash - - # A non root user is required by the python toolchain - # This is only needed because this is a Docker container. - # See error message below: - # ERROR: no such package - # '@@rules_python~~python~python_3_11_x86_64-unknown-linux-gnu//': - # The current user is root, please run as non-root when using the - # hermetic Python interpreter. - # See https://github.com/bazelbuild/rules_python/pull/713. - - name: Create a non-root user - run: | - useradd -m test - chown -R test:test $GITHUB_WORKSPACE - shell: bash diff --git a/.github/platform_environment_setup/ubuntu/action.yaml b/.github/platform_environment_setup/ubuntu/action.yaml deleted file mode 100644 index 710c3496..00000000 --- a/.github/platform_environment_setup/ubuntu/action.yaml +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright 2023 Ericsson AB -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 'Setup environment for Ubuntu' -description: 'Sets up analyzers, CodeChecker and Bazel for ubuntu CI runner' -runs: - using: "composite" - steps: - - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.15.0 - - - name: Install python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - # https://stackoverflow.com/questions/59127258/how-can-i-use-pip-cache-in-github-actions - - name: Cache pip - id: cache-pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-codechecker - - - name: Install CodeChecker analyzers - run: | - # Disable updating man-db, which is a long process - # https://askubuntu.com/a/1476024/589803 - sudo echo "set man-db/auto-update false" | \ - sudo debconf-communicate; sudo dpkg-reconfigure man-db - sudo apt-get update --quiet - sudo apt-get install --no-install-recommends \ - clang \ - clang-tools \ - clang-tidy - # The default naming of the clang-extdef-mapping, needed for CTU, is - # installed by clang-tools also contains the major version - # (e.g. clang-extdef-mapping-18), but the bazel rules reference it - # without the version number. To this end, we use update-alternatives - # to rename the binary to omit it. - sudo update-alternatives --install \ - /usr/bin/clang-extdef-mapping \ - clang-extdef-mapping \ - /usr/bin/clang-extdef-mapping-$(clang --version | head -n 1 | - sed -E 's/.*version ([0-9]+)\..*/\1/') \ - 100 - shell: bash - - - name: Install CodeChecker - run: pip3 install codechecker pylint pytest - shell: bash diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 133eda9a..df51f022 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -68,7 +68,17 @@ jobs: shell: bash - name: Setup environment - uses: ./.github/platform_environment_setup/ubuntu + uses: mamba-org/setup-micromamba@v3 + with: + environment-name: ci + environment-file: .ci/micromamba/ci.yaml + create-args: >- + bazel=${{ matrix.bazel_version }} + cache-environment: true + init-shell: bash + condarc: | + channels: + - conda-forge - name: Print versions run: | @@ -78,11 +88,13 @@ jobs: "when invoking directly, or in bazel's sandbox environment!" \ "Be sure to double check during debugging." CodeChecker analyzers + shell: bash -el {0} - name: Run lint tests run: | pylint . bazel test //:buildifier --test_output=all + shell: bash -el {0} # Splitting unit and FOSS tests, since unit tests fail faster. # Therefore: less wasted CI runtime. @@ -90,9 +102,11 @@ jobs: run: | bazel test //... pytest test/unit + shell: bash -el {0} - name: Run Open Source tests run: pytest test/foss + shell: bash -el {0} rhel9_test: name: "Tests: Bazel ${{ matrix.bazel_version }} (RHEL9)" @@ -115,29 +129,51 @@ jobs: shell: bash - name: Setup environment - uses: ./.github/platform_environment_setup/rhel9 + uses: mamba-org/setup-micromamba@v3 + with: + environment-name: ci + environment-file: .ci/micromamba/ci.yaml + create-args: >- + bazel=${{ matrix.bazel_version }} + cache-environment: true + init-shell: bash + condarc: | + channels: + - conda-forge + + - name: Create a non-root user + run: | + useradd -m test + chown -R test:test $GITHUB_WORKSPACE + chown -R test:test $HOME + chown -R test:test $MAMBA_ROOT_PREFIX + shell: bash -el {0} - name: Print versions run: | - bazel version + runuser -u test -- bazel version CodeChecker version echo "[NOTE]: CodeChecker may find different analyzer binaries" \ "when invoking directly, or in bazel's sandbox environment!" \ "Be sure to double check during debugging." CodeChecker analyzers + shell: bash -el {0} - name: Run lint tests run: | pylint . - bazel test //:buildifier --test_output=all + runuser -u test -- bazel test //:buildifier --test_output=all + shell: bash -el {0} # Splitting unit and FOSS tests, since unit tests fail faster. # Therefore: less wasted CI runtime. - name: Run unit tests run: | - bazel test //... - pytest test/unit + runuser -u test -- bazel test //... + runuser -u test -- pytest test/unit + shell: bash -el {0} - name: Run Open Source tests - run: pytest test/foss + run: runuser -u test -- pytest test/foss + shell: bash -el {0} From a3b0a56ff48af070596e24cd85bb115664123d10 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 8 Jun 2026 07:10:50 +0200 Subject: [PATCH 04/12] Change versions to those found in conda forge repositories --- .github/bazel_version.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/bazel_version.json b/.github/bazel_version.json index 599e2a0c..98faab3e 100644 --- a/.github/bazel_version.json +++ b/.github/bazel_version.json @@ -1,6 +1,6 @@ [ "6.5.0", - "7.7.0", - "8.5.0" + "7.7.1", + "8.5.1" ] From c438a6878254a2547a0d2bfbd2810ce4d3d4dea8 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 8 Jun 2026 07:17:03 +0200 Subject: [PATCH 05/12] Add gcc as dependencies (codechecker requires them) Update dev.yaml with required packages --- .ci/micromamba/ci.yaml | 2 ++ .ci/micromamba/dev.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.ci/micromamba/ci.yaml b/.ci/micromamba/ci.yaml index 3c039c41..22faf2e0 100644 --- a/.ci/micromamba/ci.yaml +++ b/.ci/micromamba/ci.yaml @@ -10,5 +10,7 @@ dependencies: - clang=21 - clang-tools=21 - bazel + - gcc + - gxx - pip: - codechecker==6.27.3 diff --git a/.ci/micromamba/dev.yaml b/.ci/micromamba/dev.yaml index 650441f4..d52ad449 100644 --- a/.ci/micromamba/dev.yaml +++ b/.ci/micromamba/dev.yaml @@ -10,5 +10,7 @@ dependencies: - clang=21 - clang-tools=21 - bazel=7.7.1 + - gcc + - gxx - pip: - codechecker==6.27.3 From 10cb1507f9457aa5cda549e33e44de6dfb964a9b Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 8 Jun 2026 10:30:14 +0200 Subject: [PATCH 06/12] Make sure git clone succeeded --- test/foss/test_foss.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/foss/test_foss.py b/test/foss/test_foss.py index 6dd78d3b..a8cbb12d 100644 --- a/test/foss/test_foss.py +++ b/test/foss/test_foss.py @@ -82,6 +82,7 @@ def test_runner(self) -> None: self.skipTest( "This project is not compatible with this bazel version" ) + self.assertTrue(os.path.exists(os.path.join(test_dir,".git"))) module_file = Path(os.path.join(test_dir, "MODULE.bazel")) if os.path.exists(module_file): content = module_file.read_text("utf-8").replace( From 872e12264ac78d08ace3377bca96beef0dedff62 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 8 Jun 2026 10:57:54 +0200 Subject: [PATCH 07/12] Add git as dependency (ubi9 does not have git by default) --- .ci/micromamba/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.ci/micromamba/ci.yaml b/.ci/micromamba/ci.yaml index 22faf2e0..2d066bf8 100644 --- a/.ci/micromamba/ci.yaml +++ b/.ci/micromamba/ci.yaml @@ -12,5 +12,6 @@ dependencies: - bazel - gcc - gxx + - git - pip: - codechecker==6.27.3 From 13c819c864f1fffb9c55f92c3174198e2553abf7 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 8 Jun 2026 13:14:08 +0200 Subject: [PATCH 08/12] Add patch file for new clang version Add patch to micromamba (used in FOSS tests) --- .ci/micromamba/ci.yaml | 1 + test/foss/yaml-cpp/init.sh | 2 ++ test/foss/yaml-cpp/yaml-cpp-070.patch | 9 +++++++++ 3 files changed, 12 insertions(+) create mode 100644 test/foss/yaml-cpp/yaml-cpp-070.patch diff --git a/.ci/micromamba/ci.yaml b/.ci/micromamba/ci.yaml index 2d066bf8..dd1754c6 100644 --- a/.ci/micromamba/ci.yaml +++ b/.ci/micromamba/ci.yaml @@ -13,5 +13,6 @@ dependencies: - gcc - gxx - git + - patch - pip: - codechecker==6.27.3 diff --git a/test/foss/yaml-cpp/init.sh b/test/foss/yaml-cpp/init.sh index d6c901b1..128250c9 100755 --- a/test/foss/yaml-cpp/init.sh +++ b/test/foss/yaml-cpp/init.sh @@ -38,6 +38,8 @@ git -C "$1" checkout yaml-cpp-0.7.0 bazelversion="../../../.bazelversion" [ -f $bazelversion ] && cp $bazelversion "$1" +patch $1/BUILD.bazel -p1 < yaml-cpp-070.patch + # Add codechecker to the project cat <> "$1/BUILD.bazel" #------------------------------------------------------- diff --git a/test/foss/yaml-cpp/yaml-cpp-070.patch b/test/foss/yaml-cpp/yaml-cpp-070.patch new file mode 100644 index 00000000..5cfd7063 --- /dev/null +++ b/test/foss/yaml-cpp/yaml-cpp-070.patch @@ -0,0 +1,9 @@ +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -10,5 +10,6 @@ + visibility = ["//visibility:public"], + includes = ["include"], + hdrs = glob(["include/**/*.h"]), ++ copts = ["-include cstdint"], + srcs = glob(["src/**/*.cpp", "src/**/*.h"]), + ) From e08e256f400d0bb3f42b1dfd1023b61a9e0beab9 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 8 Jun 2026 14:40:21 +0200 Subject: [PATCH 09/12] Make log level debug, when running github job in debug mode --- .github/workflows/test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index df51f022..61664442 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -101,11 +101,11 @@ jobs: - name: Run unit tests run: | bazel test //... - pytest test/unit + pytest test/unit ${{ runner.debug == '1' && '--log-cli-level=DEBUG' || '' }} shell: bash -el {0} - name: Run Open Source tests - run: pytest test/foss + run: pytest test/foss ${{ runner.debug == '1' && '--log-cli-level=DEBUG' || '' }} shell: bash -el {0} rhel9_test: @@ -170,10 +170,10 @@ jobs: - name: Run unit tests run: | runuser -u test -- bazel test //... - runuser -u test -- pytest test/unit + runuser -u test -- pytest test/unit ${{ runner.debug == '1' && '--log-cli-level=DEBUG' || '' }} shell: bash -el {0} - name: Run Open Source tests - run: runuser -u test -- pytest test/foss + run: runuser -u test -- pytest test/foss ${{ runner.debug == '1' && '--log-cli-level=DEBUG' || '' }} shell: bash -el {0} From 1ba9867a32e661d1d9240c634f77fa34bec74277 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 15 Jun 2026 13:58:14 +0200 Subject: [PATCH 10/12] Clean up --- .ci/micromamba/ci.yaml | 6 +++++- .ci/micromamba/dev.yaml | 2 ++ .github/bazel_version.json | 2 +- .github/workflows/test.yaml | 2 ++ requirements.txt | 2 +- test/foss/test_foss.py | 1 - test/foss/yaml-cpp/init.sh | 3 +++ test/foss/yaml-cpp/yaml-cpp-070.patch | 1 + 8 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.ci/micromamba/ci.yaml b/.ci/micromamba/ci.yaml index dd1754c6..72569049 100644 --- a/.ci/micromamba/ci.yaml +++ b/.ci/micromamba/ci.yaml @@ -1,4 +1,8 @@ -name: dev +# This file exists to have a micromamba +# environment without a fixed bazel version. +# This way the bazel version can be modified +# with commandline argument: bazel= +name: ci channels: - conda-forge dependencies: diff --git a/.ci/micromamba/dev.yaml b/.ci/micromamba/dev.yaml index d52ad449..390873ae 100644 --- a/.ci/micromamba/dev.yaml +++ b/.ci/micromamba/dev.yaml @@ -12,5 +12,7 @@ dependencies: - bazel=7.7.1 - gcc - gxx + - git + - patch - pip: - codechecker==6.27.3 diff --git a/.github/bazel_version.json b/.github/bazel_version.json index 98faab3e..7eadbe89 100644 --- a/.github/bazel_version.json +++ b/.github/bazel_version.json @@ -1,6 +1,6 @@ [ "6.5.0", "7.7.1", - "8.5.1" + "8.6.0" ] diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 61664442..2e3995e7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -67,6 +67,8 @@ jobs: run: echo "${{ matrix.bazel_version }}" > .bazelversion shell: bash + # I did not use our setup script to leverage + # the power of caching provided by this action. - name: Setup environment uses: mamba-org/setup-micromamba@v3 with: diff --git a/requirements.txt b/requirements.txt index f6a1c11c..f17bdabf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ pytest -pylint >= 4.0.0 +pylint codechecker >= 6.27.3 diff --git a/test/foss/test_foss.py b/test/foss/test_foss.py index a8cbb12d..6dd78d3b 100644 --- a/test/foss/test_foss.py +++ b/test/foss/test_foss.py @@ -82,7 +82,6 @@ def test_runner(self) -> None: self.skipTest( "This project is not compatible with this bazel version" ) - self.assertTrue(os.path.exists(os.path.join(test_dir,".git"))) module_file = Path(os.path.join(test_dir, "MODULE.bazel")) if os.path.exists(module_file): content = module_file.read_text("utf-8").replace( diff --git a/test/foss/yaml-cpp/init.sh b/test/foss/yaml-cpp/init.sh index 128250c9..00e5061b 100755 --- a/test/foss/yaml-cpp/init.sh +++ b/test/foss/yaml-cpp/init.sh @@ -38,6 +38,9 @@ git -C "$1" checkout yaml-cpp-0.7.0 bazelversion="../../../.bazelversion" [ -f $bazelversion ] && cp $bazelversion "$1" +# Using very new c compilers (e.g. clang 21) cause the build to fail +# also causing analysis to do so. +# This patch applies a compile flag to ignore the warning causing this fail. patch $1/BUILD.bazel -p1 < yaml-cpp-070.patch # Add codechecker to the project diff --git a/test/foss/yaml-cpp/yaml-cpp-070.patch b/test/foss/yaml-cpp/yaml-cpp-070.patch index 5cfd7063..2d3847de 100644 --- a/test/foss/yaml-cpp/yaml-cpp-070.patch +++ b/test/foss/yaml-cpp/yaml-cpp-070.patch @@ -4,6 +4,7 @@ visibility = ["//visibility:public"], includes = ["include"], hdrs = glob(["include/**/*.h"]), ++ # Newer compilers throw warnings without this. + copts = ["-include cstdint"], srcs = glob(["src/**/*.cpp", "src/**/*.h"]), ) From 45578c1bc1f3f44c6eadf59f9200a890dfc64a75 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Tue, 16 Jun 2026 07:00:49 +0200 Subject: [PATCH 11/12] Fix malformed patch file --- test/foss/yaml-cpp/yaml-cpp-070.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/foss/yaml-cpp/yaml-cpp-070.patch b/test/foss/yaml-cpp/yaml-cpp-070.patch index 2d3847de..9789a025 100644 --- a/test/foss/yaml-cpp/yaml-cpp-070.patch +++ b/test/foss/yaml-cpp/yaml-cpp-070.patch @@ -1,6 +1,6 @@ --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -10,5 +10,6 @@ +@@ -10,5 +10,7 @@ visibility = ["//visibility:public"], includes = ["include"], hdrs = glob(["include/**/*.h"]), From 366725f12f4309cf5a0bad459f0959e49edea85b Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Tue, 16 Jun 2026 07:20:43 +0200 Subject: [PATCH 12/12] Revert bazel version bump Bazel 8.5.1 do while 8.6.0 doesn't have the `bazel --version` functionality --- .github/bazel_version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/bazel_version.json b/.github/bazel_version.json index 7eadbe89..98faab3e 100644 --- a/.github/bazel_version.json +++ b/.github/bazel_version.json @@ -1,6 +1,6 @@ [ "6.5.0", "7.7.1", - "8.6.0" + "8.5.1" ]