From 0d5d11ae990b312980fba7b5133e5b9fc651bec9 Mon Sep 17 00:00:00 2001 From: Rohit Kumar <149245736+rkt0209@users.noreply.github.com> Date: Sun, 16 Aug 2026 21:42:36 +0530 Subject: [PATCH] Add cppcheck static-analysis CI --- .github/workflows/cppcheck.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/cppcheck.yml diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml new file mode 100644 index 0000000..5f4a44d --- /dev/null +++ b/.github/workflows/cppcheck.yml @@ -0,0 +1,34 @@ +name: cppcheck + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + workflow_dispatch: + +jobs: + cppcheck: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install cppcheck + run: | + # Retry to ride out transient Ubuntu mirror sync failures (matches build.yml) + sudo apt-get update -o Acquire::Retries=3 + sudo apt-get install -y -o Acquire::Retries=3 cppcheck + + - name: Run cppcheck + run: | + cppcheck \ + --enable=warning,performance,portability \ + --error-exitcode=1 \ + --inline-suppr \ + --suppress=missingIncludeSystem \ + --suppress=unknownMacro \ + -DVERSION="$(grep -oP 'AC_INIT\(\[[^\]]*\],\s*\[\K[^\]]*' configure.ac)" \ + .