Missing required pack msg #355
Workflow file for this run
This file contains 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: cpp-linter | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- '.github/workflows/cpp-linter.yml' | |
- '.github/.cppcheck_suppressions' | |
- '.github/cppcheck_googletest.cfg' | |
- '**/*.cpp' | |
- '**/*.h' | |
- '**/*.hpp' | |
- '**/*.in' | |
- '**/CMakeLists.txt' | |
- '!**/docs/**/*' | |
- '!**/*.md' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
linter_report: "cppcheck_report.md" | |
jobs: | |
lint: | |
name: cppcheck | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout devtools | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install cppcheck | |
- name: Run cppcheck | |
run: | | |
cppcheck --enable=performance,portability,unusedFunction,warning \ | |
--library=.github/cppcheck_googletest.cfg --suppressions-list=.github/.cppcheck_suppressions \ | |
--force -i./external --language=c++ --max-ctu-depth=20 \ | |
--platform=unix64 --std=c++17 --verbose --std=c++17 \ | |
-i./tools/buildmgr/test -i./tools/packchk/test \ | |
-i./tools/packgen/test -i./tools/projmgr/test \ | |
-i./tools/svdconv/Test -i./test \ | |
--template="|{file}|{line}|{severity}|{message}|" \ | |
--output-file=./${{ env.linter_report }} . | |
- name: Check errors | |
run: | | |
echo "value=$(test ! -s ${{ env.linter_report}} &>/dev/null ; echo $?)" >> $GITHUB_OUTPUT | |
id: errors | |
- name: Append report | |
if: ${{ steps.errors.outputs.value == '1' }} | |
run: | | |
echo -e -n "## :boom: [Linter Results](https://cppcheck.sourceforge.io/)\\n|File|Line|Severity|Message|\n|:--|:--|:--|--|\n" | cat - ./${{ env.linter_report }} > ./tmpfile | |
mv ./tmpfile ./${{ env.linter_report }} | |
- name: Archive Cppcheck results | |
if: ${{ steps.errors.outputs.value == '1' }} | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
with: | |
name: cppcheck-report | |
path: ./${{ env.linter_report }} | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Print Linter Summary | |
if: ${{ steps.errors.outputs.value == '1' }} | |
run: cat ${{ env.linter_report }} >> $GITHUB_STEP_SUMMARY | |
- name: Validate results | |
run: | | |
if [ "${{ steps.errors.outputs.value}}" = "1" ]; then | |
echo "💥 Issue(s) detected. Check summary: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
exit 1 | |
else | |
echo "👍 No issues detected." | |
fi |