-
Notifications
You must be signed in to change notification settings - Fork 12
41 lines (35 loc) · 1.2 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
40
41
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."