Skip to content

Commit 888983e

Browse files
committed
Add CodeChecker static analyzer in CI
Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
1 parent b9285b5 commit 888983e

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/codechecker.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CodeChecker Analysis
2+
3+
on:
4+
push:
5+
# branches: [main]
6+
pull_request:
7+
# branches: [main]
8+
9+
jobs:
10+
analyze:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
14+
15+
- name: Install dependencies
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install -y clang clang-tools-extra build-essential python3-pip
19+
pip3 install codechecker
20+
21+
- name: Build with compile commands
22+
run: |
23+
mkdir build && cd build
24+
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
25+
26+
- name: Run CodeChecker analyze
27+
run: |
28+
CodeChecker analyze build/compile_commands.json \
29+
--analyzers clangsa \
30+
--output ./reports
31+
32+
- name: Parse results
33+
run: CodeChecker parse ./reports
34+
35+
- name: Generate HTML report
36+
if: always()
37+
run: |
38+
CodeChecker parse ./reports \
39+
--export html \
40+
--output ./reports-html
41+
42+
- name: Upload report
43+
if: always()
44+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
45+
with:
46+
name: codechecker-report
47+
path: ./reports-html

0 commit comments

Comments
 (0)