Skip to content

Commit 42b6c39

Browse files
authored
Update cppcheck.yml to use Markdown output
Coerced cppcheck to emit markdown-compatible output, and updated the action to show this directly in the build summary.
1 parent 6efece7 commit 42b6c39

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

.github/workflows/cppcheck.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ jobs:
2828
- name: Run CppCheck
2929
run: |
3030
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
31-
cppcheck --project=compile_commands.json --std=c++11 2> cppcheck.log
31+
cppcheck --project=compile_commands.json --std=c++11 --template='### {id} - {file}:{line}\n**{severity}:** {message}\n```\n{code}\n```\n' 2> cppcheck.md
3232
- name: Add CppCheck result to job summary
3333
run: |
3434
echo "## Cppcheck output" >> $GITHUB_STEP_SUMMARY
35-
echo '```' >> $GITHUB_STEP_SUMMARY
36-
echo "$(cat cppcheck.log)" >> $GITHUB_STEP_SUMMARY
37-
echo '```' >> $GITHUB_STEP_SUMMARY
35+
echo "$(cat cppcheck.md)" >> $GITHUB_STEP_SUMMARY
3836
- name: Upload log file
3937
uses: actions/upload-artifact@v1
4038
with:
41-
name: cppcheck.log
42-
path: cppcheck.log
39+
name: cppcheck.md
40+
path: cppcheck.md

0 commit comments

Comments
 (0)