-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (58 loc) · 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#########################
#########################
## Static Analyzer C++ ##
#########################
#########################
name: C++ Syntax Check
###############################
# Start the job on edited cpp #
###############################
on:
pull_request:
types: [opened, synchronize]
branches: [ main ]
paths:
- 'include/**'
- 'src/**'
###############
# Set the Job #
###############
jobs:
cppcheck:
name: cppcheck-test
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: cppcheck
uses: deep5050/cppcheck-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
exclude_check: ./src/DSP
output_file: cppcheck.xml
other_options: --xml --suppress=missingInclude
- name: Violation Comments Action
uses: tomasbjerre/violation-comments-action@master
with:
parser: CPPCHECK
regexp: '.*cppcheck.xml$'
# Optional config below
keepOldComments: true # remove the old comments, or keep them
commentTemplate: '{{violation.message}}' # see https://github.com/tomasbjerre/violation-comments-lib
maxNumberOfViolations: 99 # Will only post this many comments
severity: INFO # INFO, WARN or ERROR
commentOnlyChangedContent: true # Comment only if violations in the changed part of PR
commentOnlyChangedFiles: true # Comment only on the files that are changed in PR
createSingleFileComments: true # Comment several comments, for each violation
createCommentWithAllSingleFileComments: false # Create on big comment with all violations
- name: Update Action Status
run: |
lines=$(wc -l <cppcheck.xml)
if [ $lines -gt 7 ]; then
exit 1
else
exit 0
fi