From b4cbf417c682101eaa7966d890490c0d6e069cd1 Mon Sep 17 00:00:00 2001 From: David Bold Date: Wed, 4 Mar 2026 10:19:03 +0100 Subject: [PATCH 1/3] Run clang-tidy on formatted files --- .github/workflows/auto-formatting.yml | 28 ++++++++++++++ .github/workflows/clang-tidy-review.yml | 49 ------------------------- 2 files changed, 28 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/clang-tidy-review.yml diff --git a/.github/workflows/auto-formatting.yml b/.github/workflows/auto-formatting.yml index b7f1584515..e53233f846 100644 --- a/.github/workflows/auto-formatting.yml +++ b/.github/workflows/auto-formatting.yml @@ -60,3 +60,31 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v7 with: commit_message: "[bot] Add last format changes commit to ignore file" + + - name: Run clang-tidy + uses: ZedThree/clang-tidy-review@v0.23.1 + id: review + with: + build_dir: build + apt_packages: "libfftw3-dev,libnetcdf-c++4-dev,libopenmpi-dev,petsc-dev,slepc-dev,liblapack-dev,libparpack2-dev,libsundials-dev,uuid-dev" + config_file: ".clang-tidy" + # Googletest triggers a _lot_ of clang-tidy warnings, so ignore all + # the unit tests until they're fixed or ignored upstream + exclude: "tests/unit/*cxx" + lgtm_comment_body: '' + cmake_command: | + pip install --break-system-packages cmake && \ + cmake --version && \ + git config --global --add safe.directory "$GITHUB_WORKSPACE" && \ + cmake . -B build -DBUILD_SHARED_LIBS=ON \ + -DBOUT_USE_PETSC=ON \ + -DBOUT_USE_SLEPC=ON \ + -DBOUT_USE_SUNDIALS=ON \ + -DBOUT_BUILD_EXAMPLES=ON \ + -DBOUT_BUILD_DOCS=OFF \ + -DBOUT_ENABLE_PYTHON=OFF \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=On \ + -DBOUT_UPDATE_GIT_SUBMODULE=OFF + + - name: Upload clang-tidy fixes + uses: ZedThree/clang-tidy-review/upload@v0.23.1 diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml deleted file mode 100644 index 360a162456..0000000000 --- a/.github/workflows/clang-tidy-review.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: clang-tidy-review - -on: - pull_request: - paths: - - '**.cxx' - - '**.hxx' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - review: - # Release candidate branches tend to have big PRs which causes all sorts of problems - if: ${{ !endsWith(github.head_ref, '-rc') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - with: - submodules: true - - - name: Run clang-tidy - uses: ZedThree/clang-tidy-review@v0.23.1 - id: review - with: - build_dir: build - apt_packages: "libfftw3-dev,libnetcdf-c++4-dev,libopenmpi-dev,petsc-dev,slepc-dev,liblapack-dev,libparpack2-dev,libsundials-dev,uuid-dev" - config_file: ".clang-tidy" - # Googletest triggers a _lot_ of clang-tidy warnings, so ignore all - # the unit tests until they're fixed or ignored upstream - exclude: "tests/unit/*cxx" - lgtm_comment_body: '' - cmake_command: | - pip install --break-system-packages cmake && \ - cmake --version && \ - git config --global --add safe.directory "$GITHUB_WORKSPACE" && \ - cmake . -B build -DBUILD_SHARED_LIBS=ON \ - -DBOUT_USE_PETSC=ON \ - -DBOUT_USE_SLEPC=ON \ - -DBOUT_USE_SUNDIALS=ON \ - -DBOUT_BUILD_EXAMPLES=ON \ - -DBOUT_BUILD_DOCS=OFF \ - -DBOUT_ENABLE_PYTHON=OFF \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=On \ - -DBOUT_UPDATE_GIT_SUBMODULE=OFF - - - name: Upload clang-tidy fixes - uses: ZedThree/clang-tidy-review/upload@v0.23.1 From 264446fdfb3d88baa5f8574c04e7103e3012598d Mon Sep 17 00:00:00 2001 From: David Bold Date: Wed, 4 Mar 2026 10:27:40 +0100 Subject: [PATCH 2/3] CI: Checkout submodules --- .github/workflows/auto-formatting.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-formatting.yml b/.github/workflows/auto-formatting.yml index e53233f846..96cb7d0523 100644 --- a/.github/workflows/auto-formatting.yml +++ b/.github/workflows/auto-formatting.yml @@ -73,6 +73,7 @@ jobs: exclude: "tests/unit/*cxx" lgtm_comment_body: '' cmake_command: | + git submodule update --init --recursive --recommend-shallow && \ pip install --break-system-packages cmake && \ cmake --version && \ git config --global --add safe.directory "$GITHUB_WORKSPACE" && \ From 9b625eb3630a78d6f747c09a89fa77bc44d6dccb Mon Sep 17 00:00:00 2001 From: David Bold Date: Wed, 4 Mar 2026 11:09:33 +0100 Subject: [PATCH 3/3] CI: mark directory as safe --- .github/workflows/auto-formatting.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-formatting.yml b/.github/workflows/auto-formatting.yml index 96cb7d0523..29a79fe334 100644 --- a/.github/workflows/auto-formatting.yml +++ b/.github/workflows/auto-formatting.yml @@ -73,6 +73,7 @@ jobs: exclude: "tests/unit/*cxx" lgtm_comment_body: '' cmake_command: | + git config --global --add safe.directory /github/workspace && \ git submodule update --init --recursive --recommend-shallow && \ pip install --break-system-packages cmake && \ cmake --version && \