update README to reflect integration of Cppcheck static analysis in C… #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cppcheck Analysis | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
cppcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository with submodules | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Cache Cppcheck | |
uses: actions/cache@v4 | |
with: | |
path: /usr/bin/cppcheck | |
key: cppcheck-cache | |
- name: Install Cppcheck (if not cached) | |
run: | | |
if ! command -v cppcheck &> /dev/null; then | |
sudo apt-get update | |
sudo apt-get install -y cppcheck | |
fi | |
- name: Run Cppcheck configuration check | |
run: | | |
cppcheck --check-config --suppress=missingIncludeSystem src/ | |
- name: Run Cppcheck analysis and generate report | |
run: | | |
cppcheck --enable=all --inconclusive --std=c++20 --xml --xml-version=2 \ | |
--template='::error file={{file}},line={{line}},:: {{message}}' \ | |
--suppress=missingIncludeSystem \ | |
--force \ | |
--output-file=cppcheck-report.xml \ | |
src/ | |
continue-on-error: true | |
- name: Upload Cppcheck report as an artifact | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cppcheck-report | |
path: cppcheck-report.xml |