From 46e5efc70d9a7afab77fe927aeac3de6b7f9c5c4 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Wed, 3 Jun 2026 19:00:28 +0200 Subject: [PATCH 1/2] CI: Fail on cppcheck.sh error Fix issue in cppcheck.sh --- .github/workflows/ci.yml | 1 - scripts/cppcheck.sh | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e1d696901f..86de706cdf7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,7 +130,6 @@ jobs: sudo apt-get -q update sudo apt-get --yes install cppcheck shellcheck - name: Cppcheck - continue-on-error: true run: | set -x scripts/cppcheck.sh diff --git a/scripts/cppcheck.sh b/scripts/cppcheck.sh index 4c2b314e426..3dd0e313548 100755 --- a/scripts/cppcheck.sh +++ b/scripts/cppcheck.sh @@ -16,6 +16,7 @@ EXHAUSTIVE=$(cppcheck --check-level=exhaustive --version > /dev/null 2>&1 && ech CPPCHKOPT=( -j "$nproc" --force "$EXHAUSTIVE" --inline-suppr ) CPPCHKOPT+=( "--enable=warning,performance,portability" ) CPPCHKOPT+=( "-I$(realpath "$(dirname "$0")/../include")" ) +CPPCHKOPT+=( --error-exitcode=1 ) if [ -n "$CPPCHECK_OPTS" ]; then read -r -a OPTS <<< "$CPPCHECK_OPTS" @@ -108,4 +109,10 @@ do docheck "$d" || result=1 done < <(find rtapi/ -type d -not -name "*__pycache__" -print0) +if [ $result -gt 0 ]; then + echo "ERROR: Issues found" +else + echo "No issues found" +fi + exit $result From 18b60657d261012b1f6f1ee4d592e0845b8e9fe3 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Wed, 3 Jun 2026 20:54:02 +0200 Subject: [PATCH 2/2] CI: Split into shellcheck / cppcheck target So if one fails, you have still the result from the other --- .github/workflows/ci.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86de706cdf7..600774dc96f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,14 +128,29 @@ jobs: run: | set -x sudo apt-get -q update - sudo apt-get --yes install cppcheck shellcheck + sudo apt-get --yes install cppcheck - name: Cppcheck run: | set -x scripts/cppcheck.sh + + shellcheck: + runs-on: ubuntu-24.04 + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + submodules: false + fetch-depth: 1 + - name: Install dependencies + run: | + set -x + sudo apt-get -q update + sudo apt-get --yes install shellcheck - name: Shellcheck continue-on-error: true run: | + set -x scripts/shellcheck.sh htmldocs: