From ffad2e8c484b43aa244c2a211107f318248eaf60 Mon Sep 17 00:00:00 2001 From: Anichitei Ionel-Cristinel <49393881+ianichitei@users.noreply.github.com> Date: Tue, 22 Sep 2020 18:04:27 +0300 Subject: [PATCH 1/4] Run cppcheck on new commits and PRs --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1599b3c..3a4ff93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,3 +76,14 @@ jobs: run: MSBuild /t:Rebuild /p:Configuration=Release /p:Platform=x64 bddisasm.sln - name: Build bddisasm and bdshemu for Win32 run: MSBuild /t:Rebuild /p:Configuration=Release /p:Platform=Win32 bddisasm.sln + + Code checks: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Install cppcheck + run: sudo apt install -y cppcheck + - name: Run cppcheck + run: cppcheck --language=c --enable=all -I inc/ -I inc/bdshemu -I bddisasm/include bddisasm/ bdshemu/ From 45c9efd024453c0e4ac01943deca19e8236bc67b Mon Sep 17 00:00:00 2001 From: Anichitei Ionel-Cristinel <49393881+ianichitei@users.noreply.github.com> Date: Tue, 22 Sep 2020 18:06:45 +0300 Subject: [PATCH 2/4] workflows/ci.yml: Fix Code check job name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a4ff93..f48a810 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: - name: Build bddisasm and bdshemu for Win32 run: MSBuild /t:Rebuild /p:Configuration=Release /p:Platform=Win32 bddisasm.sln - Code checks: + Code-checks: runs-on: ubuntu-latest From ad95383878d89280959092215c120a8a29f4d664 Mon Sep 17 00:00:00 2001 From: Anichitei Ionel-Cristinel <49393881+ianichitei@users.noreply.github.com> Date: Tue, 22 Sep 2020 18:22:28 +0300 Subject: [PATCH 3/4] workflows/ci.yml: Overwrite cppcheck error code By default cppcheck returns 0 even if it encounters problems. Overwrite this with 1. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f48a810..1fa4dbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,4 +86,4 @@ jobs: - name: Install cppcheck run: sudo apt install -y cppcheck - name: Run cppcheck - run: cppcheck --language=c --enable=all -I inc/ -I inc/bdshemu -I bddisasm/include bddisasm/ bdshemu/ + run: cppcheck --error-exitcode=1 --language=c --enable=all -I inc/ -I inc/bdshemu -I bddisasm/include bddisasm/ bdshemu/ From 73bdb2328424346e95afb8e7f1d18f572c737a01 Mon Sep 17 00:00:00 2001 From: Anichitei Ionel-Cristinel <49393881+ianichitei@users.noreply.github.com> Date: Tue, 22 Sep 2020 18:26:33 +0300 Subject: [PATCH 4/4] workflows/ci.yml: Suppress unneeded code checks --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fa4dbe..d71e0d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,4 +86,7 @@ jobs: - name: Install cppcheck run: sudo apt install -y cppcheck - name: Run cppcheck - run: cppcheck --error-exitcode=1 --language=c --enable=all -I inc/ -I inc/bdshemu -I bddisasm/include bddisasm/ bdshemu/ + run: cppcheck --error-exitcode=1 --language=c \ + --enable=all --suppress=missingIncludeSystem --suppress=unusedStructMember --suppress=unusedFunction \ + -I inc/ -I inc/bdshemu -I bddisasm/include bddisasm/ bdshemu/ \ + /