From 38dc65180bdbe9468d30fac15c8bc1a1edd62439 Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Sun, 23 Jul 2023 03:50:05 +0000 Subject: [PATCH] Fixed checking cppcheck version in ci.yml --- .github/workflows/ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1413885..06f5718 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,8 +101,8 @@ jobs: - name: Cppcheck run: | - # work around resource leak false positives on older and newer Linux distributions - if cppcheck --version | awk '{if ($2 <= 1.86 || $2 >= 2.10) { exit(1) } }'; then + # specify the version range to run cppcheck (cppcheck version number is x.y or x.y.z) + if cppcheck --version | sed -e 's/\./ /g' | awk '{if (($2 * 1000 + $3) <= 1086 || ($2 * 1000 + $3) >= 2010) { exit(1) } }'; then make cppcheck fi @@ -165,7 +165,10 @@ jobs: - name: Cppcheck run: | - make cppcheck + # specify the version range to run cppcheck (cppcheck version number is x.y or x.y.z) + if cppcheck --version | sed -e 's/\./ /g' | awk '{if (($2 * 1000 + $3) <= 1086 || ($2 * 1000 + $3) >= 2010) { exit(1) } }'; then + make cppcheck + fi - name: Shellcheck run: |