diff --git a/clang-tidy/action.yaml b/clang-tidy/action.yaml index 81ea18d2..b0429093 100644 --- a/clang-tidy/action.yaml +++ b/clang-tidy/action.yaml @@ -55,7 +55,7 @@ runs: - name: Install Clang-Tidy run: | sudo apt-get -yqq update - sudo apt-get -yqq install clang-tidy libomp-dev + sudo apt-get -yqq install clang-tidy-14 libomp-14-dev clang-tidy-15 shell: bash - name: Set git config @@ -139,7 +139,7 @@ runs: if: ${{ steps.get-target-files.outputs.target-files != '' }} run: | mkdir /tmp/clang-tidy-result - run-clang-tidy -p build/ -export-fixes /tmp/clang-tidy-result/fixes.yaml -j $(nproc) ${{ steps.get-target-files.outputs.target-files }} > /tmp/clang-tidy-result/report.log && true + run-clang-tidy-15 -clang-tidy-binary /usr/bin/clang-tidy-14 -p build/ -export-fixes /tmp/clang-tidy-result/fixes.yaml -j $(nproc) -use-color false ${{ steps.get-target-files.outputs.target-files }} > /tmp/clang-tidy-result/report.log && true echo "exit_code=$?" >> $GITHUB_ENV echo "${{ github.event.number }}" > /tmp/clang-tidy-result/pr-id.txt echo "${{ github.event.pull_request.head.repo.full_name }}" > /tmp/clang-tidy-result/pr-head-repo.txt @@ -152,6 +152,16 @@ runs: with: files: /tmp/clang-tidy-result/report.log + - name: Setup Problem Matcher + if: ${{ steps.check-report-log-existence.outputs.exists == 'true' }} + run: echo "::add-matcher::$GITHUB_ACTION_PATH/problem-matcher.json" + shell: bash + + - name: Show clang-tidy result + if: ${{ steps.check-report-log-existence.outputs.exists == 'true' }} + run: cat /tmp/clang-tidy-result/report.log + shell: bash + - name: Check if the fixes.yaml file exists id: check-fixes-yaml-existence uses: autowarefoundation/autoware-github-actions/check-file-existence@v1 diff --git a/clang-tidy/problem-matcher.json b/clang-tidy/problem-matcher.json new file mode 100644 index 00000000..19b1480c --- /dev/null +++ b/clang-tidy/problem-matcher.json @@ -0,0 +1,18 @@ +{ + "problemMatcher": [ + { + "owner": "clang-tidy", + "pattern": [ + { + "regexp": "^(.*):(\\d+):(\\d+):\\s(warning|error):\\s(.*)\\s\\[(.*)\\]$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5, + "code": 6 + } + ] + } + ] +}