Add static code analysis build targets and CI workflow#32
Conversation
| run: git submodule update --init --recursive | ||
|
|
||
| - name: Configure CMake | ||
| run: mkdir build && cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. |
There was a problem hiding this comment.
Ninja pipeline generates files with includes of some *.xml.h files that apparently are not found during build targeting clang-tidy causing compilation errors. Either use -G "Unix Makefiles" or skip the -G option entirely.
There was a problem hiding this comment.
Fixed in commit 1589797. Removed -G Ninja and switched to the default Unix Makefiles generator to avoid the *.xml.h include issues.
| run: git submodule update --init --recursive | ||
|
|
||
| - name: Configure CMake | ||
| run: mkdir build && cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. |
There was a problem hiding this comment.
The gcc workflow fails with the following output:
43m 38s
Run cd build && cmake --build . --target gcc-analyzer
ninja: build stopped: interrupted by user.
Error: Process completed with exit code 143.
https://github.com/veritaware/Besprited/actions/runs/21769371294/job/62813407431?pr=32
I'd suggest also dropping the use of ninja here
There was a problem hiding this comment.
Fixed in commit 1589797. Removed Ninja generator from the gcc-analyzer job to resolve the build timeout/interruption issue.
| run: git submodule update --init --recursive | ||
|
|
||
| - name: Configure CMake | ||
| run: mkdir build && cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. |
There was a problem hiding this comment.
Ninja pipeline generates files with includes of some *.xml.h files that apparently are not found during build targeting cppcheck causing compilation errors. Either use -G "Unix Makefiles" or skip the -G option entirely.
There was a problem hiding this comment.
Fixed in commit 1589797. Removed -G Ninja and switched to the default Unix Makefiles generator to avoid the *.xml.h include issues.
4521626 to
f3c171f
Compare
- Added CMake custom targets for cppcheck, clang-tidy, and gcc-analyzer - Created GitHub Actions workflow for running static code analysis - Each analysis tool runs in a separate job with continue-on-error - Tools automatically detect if they're available on the system Add documentation for static code analysis targets - Added comprehensive documentation to INSTALL.md - Documented all three analysis targets (cppcheck, clang-tidy, gcc-analyzer) - Included installation instructions for analysis tools on all platforms - Updated table of contents PERFORM_CA NO_SW_CHANGE
f3c171f to
0789c96
Compare
Adds CMake targets and GitHub Actions workflow for automated static code analysis.
Changes
CMakeLists.txt
cppcheck,clang-tidy,gcc-analyzergcc-analyzertarget builds with GCC-fanalyzerflag in separate build directoryGitHub Actions Workflow
continue-on-error: trueto surface all issues without blockingcontents: readpermissions set per jobDocumentation
Usage
No dependencies added. Analysis tools are optional and detected at configure time. Analysis results are displayed in the build output logs.
PERFORM_CA
NO_SW_CHANGE