-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (45 loc) · 1.26 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
42
43
44
45
46
47
48
49
50
51
52
53
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