feat(traffic_light_multi_camera_fusion): add signal consistency check… #43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: cppcheck | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| cppcheck: | |
| runs-on: ubuntu-latest | |
| container: ros:jazzy | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install Cppcheck | |
| run: | | |
| apt-get update | |
| apt-get install -y cppcheck | |
| # cspell: ignore suppr Dslots | |
| - name: Run Cppcheck on all files | |
| continue-on-error: true | |
| id: cppcheck | |
| run: | | |
| cppcheck --enable=all --inconclusive --check-level=exhaustive -D'PLUGINLIB_EXPORT_CLASS(class_type, base_class)=' -Dslots= -DQ_SLOTS= --error-exitcode=1 --xml --suppressions-list=.cppcheck_suppressions --inline-suppr . 2> cppcheck-report.xml | |
| shell: bash | |
| - name: Count errors by error ID and severity | |
| run: | | |
| #!/bin/bash | |
| temp_file=$(mktemp) | |
| grep -oP '(?<=id=")[^"]+" severity="[^"]+' cppcheck-report.xml | sed 's/" severity="/,/g' > "$temp_file" || true | |
| echo "Error counts by error ID and severity:" | |
| sort "$temp_file" | uniq -c | |
| rm "$temp_file" | |
| shell: bash | |
| - name: Upload Cppcheck report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cppcheck-report | |
| path: cppcheck-report.xml | |
| - name: Fail the job if Cppcheck failed | |
| if: steps.cppcheck.outcome == 'failure' | |
| run: exit 1 |