-
Notifications
You must be signed in to change notification settings - Fork 12
39 lines (32 loc) · 1.29 KB
/
cppcheck.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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: |
mkdir -p reports
cppcheck --enable=all --inconclusive --error-exitcode=1 --force --inline-suppr --project="${{ github.workspace }}/build/compile_commands.json" --suppress=missingIncludeSystem 2>&1 | tee cppcheck_console.txt
cppcheck --enable=all --inconclusive --error-exitcode=1 --force --inline-suppr --project="${{ github.workspace }}/build/compile_commands.json" --suppress=missingIncludeSystem --xml --output-file="${{ github.workspace }}/reports/cppcheck_results.xml"
- name: Upload analysis results
if: always()
uses: actions/upload-artifact@v3
with:
name: cppcheck-results
path: |
reports/cppcheck_results.xml
cppcheck_console.txt