-
Notifications
You must be signed in to change notification settings - Fork 50
48 lines (42 loc) · 1.27 KB
/
cppcheck.yml
File metadata and controls
48 lines (42 loc) · 1.27 KB
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
name: Cppcheck
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:
jobs:
cppcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install cppcheck
run: |
sudo apt-get update --fix-missing -y
sudo apt-get install -y cppcheck
# Set up GitHub caching to store cppcheck's analysis state
- name: Cache cppcheck build state
uses: actions/cache@v4
with:
path: cppcheck-build-dir
key: ${{ runner.os }}-cppcheck-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cppcheck-${{ github.ref }}-
${{ runner.os }}-cppcheck-
- name: Run cppcheck
run: |
# Create the cache directory if it doesn't exist
mkdir -p cppcheck-build-dir
# Run cppcheck with parallel jobs and caching enabled
cppcheck \
-j $(nproc) \
--cppcheck-build-dir=cppcheck-build-dir \
--enable=warning,performance,portability \
--error-exitcode=1 \
--inline-suppr \
--suppress=missingIncludeSystem \
--suppress=unknownMacro \
.