Skip to content

Commit bace26c

Browse files
committed
Added a quick cppcheck workflow to do some basic static code analysis
1 parent 490a890 commit bace26c

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/cppcheck.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build Natively
2+
3+
on:
4+
commit:
5+
branches: ['main', 'master']
6+
push:
7+
branches: '*'
8+
pull_request:
9+
branches: '*'
10+
11+
jobs:
12+
cppcheck:
13+
runs-on: ubuntu-20.04
14+
name: Static Analysis Report
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Install CppCheck
18+
run: |
19+
sudo apt-get update
20+
sudo apt-get install -y cppcheck
21+
- name: Setup arm-none-eabi-gcc
22+
uses: carlosperate/arm-none-eabi-gcc-action@v1
23+
with:
24+
release: latest
25+
- name: Setup CMake
26+
uses: jwlawson/actions-setup-cmake@v1
27+
- name: Build default project using build.py
28+
run: python build.py
29+
- name: Run CppCheck
30+
run: |
31+
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
32+
cppcheck --project=compile_commands.json --std=c++11 2> cppcheck.log
33+
- name: Upload log file
34+
uses: actions/upload-artifact@v1
35+
with:
36+
name: cppcheck.log
37+
path: cppcheck.log

0 commit comments

Comments
 (0)