From 51c890ed6b1b23aea4e59a05c8f4380d656ee5cd Mon Sep 17 00:00:00 2001 From: Filipp Pavlov Date: Fri, 9 Oct 2026 15:26:27 +0000 Subject: [PATCH 1/8] Add a test clang-tidy workflow --- .github/workflows/clang_tidy.yml | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/clang_tidy.yml diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml new file mode 100644 index 0000000..8262a55 --- /dev/null +++ b/.github/workflows/clang_tidy.yml @@ -0,0 +1,42 @@ +name: clang-tidy + +on: + workflow_dispatch: + + pull_request: + branches: [main] + paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', '**.cmake'] + +jobs: + lint: + runs-on: windows + + # Set required permissions if using thread comments or PR reviews + permissions: + contents: read + pull-requests: write + + steps: + - name: Checkout Repository + uses: actions/checkout@v7 + + - name: Configure CMake + # -DCMAKE_EXPORT_COMPILE_COMMANDS=ON tells CMake to create compile_commands.json + run: cmake -B build -S . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + + - name: Run clang-tidy + uses: cpp-linter/cpp-linter-action@v2 + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: '' # Uses the .clang-format file in your repository + # Point the action to the database generated by CMake in the 'build' folder + database: 'build' + thread-comments: true + + - name: Fail workflow if checks failed + if: steps.linter.outputs.checks-failed != 0 + run: | + echo "Linter detected clang-tidy errors." + exit 1 \ No newline at end of file From 89f47b63f93568299ac63f7f37d703d87ae9c427 Mon Sep 17 00:00:00 2001 From: filipppavlov Date: Fri, 9 Oct 2026 15:30:46 +0000 Subject: [PATCH 2/8] Potential fix for pull request finding 'Correctly document clang-format style configuration' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/clang_tidy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index 8262a55..d005584 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -30,7 +30,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - style: '' # Uses the .clang-format file in your repository + style: '' # Disable clang-format for this clang-tidy-only workflow # Point the action to the database generated by CMake in the 'build' folder database: 'build' thread-comments: true From b1d53838c9ed2ec20c263e439b634f18164aae41 Mon Sep 17 00:00:00 2001 From: Filipp Pavlov Date: Fri, 9 Oct 2026 15:31:21 +0000 Subject: [PATCH 3/8] temporarily remove file filtering --- .github/workflows/clang_tidy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index d005584..e31c90f 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -5,7 +5,7 @@ on: pull_request: branches: [main] - paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', '**.cmake'] + # paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', '**.cmake'] jobs: lint: From f61080a6ec2853dcc1dd368a55e987dcf39741e9 Mon Sep 17 00:00:00 2001 From: Filipp Pavlov Date: Fri, 9 Oct 2026 15:33:30 +0000 Subject: [PATCH 4/8] fix the runner name --- .github/workflows/clang_tidy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index e31c90f..b72c76d 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -9,7 +9,7 @@ on: jobs: lint: - runs-on: windows + runs-on: windows-latest # Set required permissions if using thread comments or PR reviews permissions: From 98febb8ad69325ad3ec82b49ab81d715021a1557 Mon Sep 17 00:00:00 2001 From: Filipp Pavlov Date: Fri, 9 Oct 2026 15:40:15 +0000 Subject: [PATCH 5/8] set up vcpkg --- .github/workflows/clang_tidy.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index b72c76d..876d9cf 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -8,7 +8,7 @@ on: # paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', '**.cmake'] jobs: - lint: + clang-tidy: runs-on: windows-latest # Set required permissions if using thread comments or PR reviews @@ -20,6 +20,11 @@ jobs: - name: Checkout Repository uses: actions/checkout@v7 + - name: Set up vcpkg + uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: 'latest' + - name: Configure CMake # -DCMAKE_EXPORT_COMPILE_COMMANDS=ON tells CMake to create compile_commands.json run: cmake -B build -S . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON From fb8a2e3993e2198a0d9422656c563ae77ed56b2e Mon Sep 17 00:00:00 2001 From: Filipp Pavlov Date: Fri, 9 Oct 2026 15:41:28 +0000 Subject: [PATCH 6/8] fix vcpkg step --- .github/workflows/clang_tidy.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index 876d9cf..f684e48 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -22,8 +22,6 @@ jobs: - name: Set up vcpkg uses: lukka/run-vcpkg@v11 - with: - vcpkgGitCommitId: 'latest' - name: Configure CMake # -DCMAKE_EXPORT_COMPILE_COMMANDS=ON tells CMake to create compile_commands.json From 48cb9827d7b995721f32ef4d5b9a3fe5c573ed92 Mon Sep 17 00:00:00 2001 From: Filipp Pavlov Date: Fri, 9 Oct 2026 15:45:02 +0000 Subject: [PATCH 7/8] use a preset --- .github/workflows/clang_tidy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index f684e48..80bf5b3 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -25,7 +25,7 @@ jobs: - name: Configure CMake # -DCMAKE_EXPORT_COMPILE_COMMANDS=ON tells CMake to create compile_commands.json - run: cmake -B build -S . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + run: cmake -B build -S . --preset x64-windows-release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - name: Run clang-tidy uses: cpp-linter/cpp-linter-action@v2 From f255fcd74568dbe8ad2917602cd161b3c3c8ba09 Mon Sep 17 00:00:00 2001 From: Filipp Pavlov Date: Fri, 9 Oct 2026 15:50:40 +0000 Subject: [PATCH 8/8] check out submodules --- .github/workflows/clang_tidy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index 80bf5b3..27dd2cf 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -19,7 +19,9 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v7 - + with: + submodules: recursive + - name: Set up vcpkg uses: lukka/run-vcpkg@v11