From 29f705c22ae1a3510e547cd5ded8641af8c0a47a Mon Sep 17 00:00:00 2001 From: Ivan Date: Wed, 21 Oct 2026 16:55:54 +0300 Subject: [PATCH] Build out of tree so clang-tidy sees changed src lines In-tree builds pass relative names that clang-tidy-diff's line filter cannot match. --- .github/workflows/static-analysis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 321af542..96dae5e7 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -50,16 +50,19 @@ jobs: autoconf -i autoheader automake --add-missing - ./configure + mkdir build + cd build + "${GITHUB_WORKSPACE}/configure" - name: Prepare compile_commands.json run: | - bear -- make + cd build + bear -- make check TESTS= - name: Create results directory run: | mkdir clang-tidy-result - name: Analyze run: | - git diff -U0 "$(git merge-base HEAD "upstream/${{ github.event.pull_request.base.ref }}")" | clang-tidy-diff -p1 -path build -export-fixes clang-tidy-result/fixes.yml "-extra-arg=-include/${PWD}/config.h" + git diff -U0 "$(git merge-base HEAD "upstream/${{ github.event.pull_request.base.ref }}")" | clang-tidy-diff -p1 -path build -export-fixes clang-tidy-result/fixes.yml "-extra-arg=-include/${PWD}/build/config.h" - name: Save PR metadata run: | echo "${{ github.event.number }}" > clang-tidy-result/pr-id.txt