From 75c85b4bbb2e64770c92b9468abbfec359f7a9f6 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 3 Jan 2025 20:14:30 +0100 Subject: [PATCH] CI: make cppcheck_master fail on push if cppcheck fails (but not on PR) --- .github/workflows/code_checks.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index 1b1ca3aece92..d0e9fa46d6a7 100644 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -93,7 +93,14 @@ jobs: cd build cmake .. - - name: Run cppcheck test + - name: Run cppcheck test (on push events) + if: ${{ github.event_name == 'push' }} + run: | + cd build + ../scripts/cppcheck.sh + + - name: Run cppcheck test, but ignore failures (on pull request) + if: ${{ github.event_name == 'pull_request' }} run: | cd build # Do not fail the job. This is just used as a tool to monitor how we are regarding recent cppcheck