Skip to content

Commit 33bf304

Browse files
committed
Add cppcheck composite action and integrate into all workflows
1 parent 7ed1126 commit 33bf304

5 files changed

Lines changed: 32 additions & 1 deletion

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
# BSD 3-Clause License
3+
# Copyright (C) 2026 Intel Corporation
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
#
6+
name: 'cppcheck'
7+
description: 'Run cppcheck static analysis'
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: cppcheck
13+
shell: bash
14+
run: |
15+
REPORT_DIR="$HOME/static-analysis/${{ github.repository }}/${{ github.run_id }}"
16+
mkdir -p "$REPORT_DIR"
17+
cppcheck \
18+
--enable=warning,style,performance,portability \
19+
--std=c11 --force --inline-suppr \
20+
--suppress=missingIncludeSystem \
21+
-Iinclude src 2>&1 | tee "$REPORT_DIR/cppcheck-report.txt" || true
22+
echo "cppcheck scan complete. Report saved to $REPORT_DIR/cppcheck-report.txt"

.github/actions/environment-check/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ runs:
5454
run: |
5555
echo "===== Analysis Tools Check ====="
5656
MISSING=""
57-
for TOOL in shellcheck; do
57+
for TOOL in shellcheck cppcheck; do
5858
if command -v "$TOOL" &>/dev/null; then
5959
echo " [OK] $TOOL ($(command -v "$TOOL"))"
6060
else

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
- name: ShellCheck
4646
uses: ./.github/actions/analysis/shellcheck
4747

48+
- name: cppcheck
49+
uses: ./.github/actions/analysis/cppcheck
50+
4851
- name: Coverity Scan
4952
uses: ./.github/actions/analysis/coverity
5053

.github/workflows/daily_build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
- name: ShellCheck
4949
uses: ./.github/actions/analysis/shellcheck
5050

51+
- name: cppcheck
52+
uses: ./.github/actions/analysis/cppcheck
53+
5154
- name: Coverity Scan
5255
uses: ./.github/actions/analysis/coverity
5356

.github/workflows/pull_request.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
- name: ShellCheck
4949
uses: ./.github/actions/analysis/shellcheck
5050

51+
- name: cppcheck
52+
uses: ./.github/actions/analysis/cppcheck
53+
5154
- name: Coverity Scan
5255
uses: ./.github/actions/analysis/coverity
5356

0 commit comments

Comments
 (0)