Skip to content

Commit

Permalink
fix: cppcheck report can now be on multiple lines in static analysis …
Browse files Browse the repository at this point in the history
…workflow
  • Loading branch information
SuperFola committed Apr 17, 2024
1 parent 2bee12e commit e180f33
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ jobs:
shell: bash
run: |
cppcheck --platform=unix64 --template="{file}:{line}: {severity}: {message}" \
--output-file=cppcheck.txt -j $(nproc) \
--output-file=cppcheck.txt \
-I include src \
--enable=all --inline-suppr \
--suppressions-list=cppcheck-suppressions.txt
cat cppcheck.txt | sort > cppcheck_sorted.txt
echo "report=$(cat cppcheck_sorted.txt)" >> $GITHUB_OUTPUT
echo "CPPCHECK_REPORT<<EOF" >> $GITHUB_ENV
echo "| Filename | Line | Type | Description |" >> $GITHUB_ENV
echo "| -------- | ---- | ---- | ----------- |" >> $GITHUB_ENV
cat cppcheck_sorted.txt | awk -F ":" '{type=$3;out=""; for (i = 4; i <= NF; i++) {out = out " " $i}; print $1 " | " $2 " |" type " |" out}' >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Find Comment
uses: peter-evans/find-comment@v3
Expand All @@ -60,6 +64,6 @@ jobs:
### CppCheck report
```
${{ steps.cppcheck.outputs.report }}
${{ env.CPPCHECK_REPORT }}
```
edit-mode: replace

0 comments on commit e180f33

Please sign in to comment.