Skip to content

chore: show cppcheck results in CI logs instead of artifacts #25

chore: show cppcheck results in CI logs instead of artifacts

chore: show cppcheck results in CI logs instead of artifacts #25

Workflow file for this run

name: Static Analysis
on:
push:
branches: [ "master", "main", "devin/*" ]
pull_request:
jobs:
cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib cppcheck
- name: Configure CMake
run: cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build
run: cmake --build build
- name: Run cppcheck
run: |
echo "Running static analysis with cppcheck..."
echo "----------------------------------------"
cppcheck \
--enable=warning,performance,portability \
--error-exitcode=1 \
--force \
--inline-suppr \
--suppress=nullPointerRedundantCheck:*/n_cjson.c \
--project="${{ github.workspace }}/build/compile_commands.json" \
--suppress=missingIncludeSystem \
--template="{file}:{line}: {severity}: {message}" \
2>&1 | tee >(cat)
echo "----------------------------------------"
echo "Static analysis complete."