From f4f7a814e77dc338db655987f6eb1beb6e3ae7ea Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Thu, 22 Feb 2024 10:41:35 -0300 Subject: build: sync cppcheck targets with CI Changes: * Use the same command from the cppcheck CI job in the cppcheck target * Add cppcheck-old target based on the cppcheck_old CI job * Call the make targets in CI to avoid duplicating the commands --- .github/workflows/check-c.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/check-c.yml b/.github/workflows/check-c.yml index deadfcb07..c308e3620 100644 --- a/.github/workflows/check-c.yml +++ b/.github/workflows/check-c.yml @@ -93,11 +93,13 @@ jobs: run: sudo apt-get update -qy - name: install cppcheck run: sudo apt-get install -qy cppcheck + - name: configure + run: > + ./configure CPPCHECK='cppcheck -q' + || (cat config.log; exit 1) - run: cppcheck --version - name: cppcheck - run: > - cppcheck -q --force --error-exitcode=1 --enable=warning,performance - -i src/firejail/checkcfg.c -i src/firejail/main.c . + run: make cppcheck # new cppcheck version currently chokes on checkcfg.c and main.c, therefore # scan all files also with older cppcheck version from ubuntu 20.04. @@ -122,9 +124,13 @@ jobs: run: sudo apt-get update -qy - name: install cppcheck run: sudo apt-get install -qy cppcheck + - name: configure + run: > + ./configure CPPCHECK='cppcheck -q' + || (cat config.log; exit 1) - run: cppcheck --version - - name: cppcheck - run: cppcheck -q --force --error-exitcode=1 --enable=warning,performance . + - name: cppcheck-old + run: make cppcheck-old codeql-cpp: permissions: -- cgit v1.2.3-54-g00ecf From 1f6400bd89913d804b9803394c9c1bb629a7e97f Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Sat, 24 Feb 2024 03:49:54 -0300 Subject: build: sync scan-build target with CI Changes: * Use --status-bugs in the scan-build target to exit with an error if bugs are found * Call the make target in the CI job --- .github/workflows/check-c.yml | 6 +++--- Makefile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/check-c.yml b/.github/workflows/check-c.yml index c308e3620..b4ff6fd9c 100644 --- a/.github/workflows/check-c.yml +++ b/.github/workflows/check-c.yml @@ -67,11 +67,11 @@ jobs: run: ./ci/printenv.sh - name: configure run: > - CC=clang-14 ./configure --enable-fatal-warnings --enable-apparmor - --enable-selinux + ./configure CC=clang-14 SCAN_BUILD=scan-build-14 + --enable-fatal-warnings --enable-apparmor --enable-selinux || (cat config.log; exit 1) - name: scan-build - run: scan-build-14 --status-bugs make + run: make scan-build cppcheck: runs-on: ubuntu-22.04 diff --git a/Makefile b/Makefile index d6d4f098c..dcd84b7ab 100644 --- a/Makefile +++ b/Makefile @@ -374,7 +374,7 @@ cppcheck-old: clean .PHONY: scan-build scan-build: clean - $(SCAN_BUILD) $(MAKE) + $(SCAN_BUILD) --status-bugs $(MAKE) # TODO: Old codespell versions (such as v2.1.0 in CI) have issues with # contrib/syscalls.sh -- cgit v1.2.3-54-g00ecf