diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5706046b..96cf0fa32 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -149,11 +149,20 @@ jobs: - name: clang-tidy review if: (startsWith(matrix.os, 'ubuntu') && matrix.pch == false && matrix.qt-version == '5.15.2' && github.event_name == 'pull_request') - uses: ZedThree/clang-tidy-review@v0.9.0 + uses: pajlada/clang-tidy-review@feat/split-up-review-and-post-workflows id: review with: build_dir: build config_file: '.clang-tidy' + split_workflow: true + + - uses: actions/upload-artifact@v3 + if: (startsWith(matrix.os, 'ubuntu') && matrix.pch == false && matrix.qt-version == '5.15.2' && github.event_name == 'pull_request') + with: + name: clang-tidy-review + path: | + clang-tidy-review-output.json + clang-tidy-review-metadata.json - name: Package - AppImage (Ubuntu) if: startsWith(matrix.os, 'ubuntu') diff --git a/.github/workflows/post-clang-tidy-review.yml b/.github/workflows/post-clang-tidy-review.yml new file mode 100644 index 000000000..8a49322b9 --- /dev/null +++ b/.github/workflows/post-clang-tidy-review.yml @@ -0,0 +1,39 @@ +--- +name: Post clang-tidy review comments + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: 'Download artifact' + uses: actions/github-script@v6 + with: + script: | + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id }}, + }); + const matchArtifact = artifacts.data.artifacts.filter((artifact) => { + return artifact.name == "clang-tidy-review" + })[0]; + const download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + const fs = require('fs'); + fs.writeFileSync('${{github.workspace}}/clang-tidy-review.zip', Buffer.from(download.data)); + - name: 'Unzip artifact' + run: unzip clang-tidy-review.zip + + - uses: pajlada/clang-tidy-review/post@feat/split-up-review-and-post-workflows + id: review