From 4fb907fc50893f16687d3f94b4b80bb996853300 Mon Sep 17 00:00:00 2001 From: Kent Slaney Date: Tue, 6 Feb 2024 16:14:57 -0800 Subject: [PATCH] experiment to see if newer cppcheck solves exit code problem --- .github/workflows/cpp.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index c82e2482..0f22d710 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -15,7 +15,16 @@ jobs: - name: Setup system dependencies run: | sudo apt-get update - sudo apt-get -y install cppcheck + apt_version=`apt show cppcheck 2>/dev/null | grep Version | cut -d' ' -f2` + if [ `echo -e "$apt_version\n2.13.0" | sort -V | head -1` == "2.13.0" ]; then + sudo apt-get -y install cppcheck + else + curl -OL https://github.com/danmar/cppcheck/archive/2.13.0.tar.gz + tar xf 2.13.0.tar.gz + cd cppcheck-2.13.0/ + sudo make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function" install + cd .. + fi - name: Run cppcheck run: | ./misc/travis/cppcheck.sh