[projmgr] Align telnet test case with debug adapter registry (#1372)
#659
Workflow file for this run
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: 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" | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: cppcheck | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Harden Runner | |
| if: ${{ !github.event.repository.private }} | |
| uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout devtools | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - 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@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.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 |