diff --git a/.github/workflows/cppcheck-all.yaml b/.github/workflows/cppcheck-all.yaml index 49969b7a5ddae..94f04d2a02f22 100644 --- a/.github/workflows/cppcheck-all.yaml +++ b/.github/workflows/cppcheck-all.yaml @@ -51,7 +51,7 @@ jobs: - name: Upload Cppcheck report uses: actions/upload-artifact@v2 with: - name: latest-cppcheck-report + name: cppcheck-report path: cppcheck-report.xml - name: Fail the job if Cppcheck failed diff --git a/.github/workflows/cppcheck-differential.yaml b/.github/workflows/cppcheck-differential.yaml index fb8bb2b251d52..01223628eb895 100644 --- a/.github/workflows/cppcheck-differential.yaml +++ b/.github/workflows/cppcheck-differential.yaml @@ -36,6 +36,8 @@ jobs: cat changed_files.txt - name: Run Cppcheck on changed files + continue-on-error: true + id: cppcheck run: | files=$(cat changed_files.txt | grep -E '\.(cpp|hpp)$' || true) if [ -n "$files" ]; then @@ -46,3 +48,13 @@ jobs: echo "No C++ files changed." fi shell: bash + + - name: Upload Cppcheck report + uses: actions/upload-artifact@v2 + with: + name: cppcheck-report + path: cppcheck-report.txt + + - name: Fail the job if Cppcheck failed + if: steps.cppcheck.outcome == 'failure' + run: exit 1