-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (26 loc) · 970 Bytes
/
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
name: Cppcheck
on: [pull_request]
env:
WORKSPACE: ${{ github.workspace }}
jobs:
cppcheck:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup cppcheck
run: |
sudo apt-get update
sudo apt-get install cppcheck
- name: Run cppcheck
run: |
cd ${{ env.WORKSPACE }}
cppcheck --enable=all --output-file=cppcheck-result.txt --force --quiet -I Library Projects
- name: Setup reviewdog
uses: reviewdog/action-setup@80a06617492b461a66508e2dedf16233f0506804
- name: Comment GitHub Pull Request
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cat cppcheck-result.txt | grep "\bwarning: " | reviewdog -efm="%f:%l:%c:%m" -reporter=github-pr-review -name="cppcheck-warning"
cat cppcheck-result.txt | grep "\berror: " | reviewdog -efm="%f:%l:%c:%m" -reporter=github-pr-review -name="cppcheck-error"