Report #3
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: Report | |
| on: | |
| workflow_run: | |
| workflows: ["CI", "Benchmark"] | |
| types: [completed] | |
| permissions: | |
| pull-requests: write | |
| actions: read | |
| jobs: | |
| report: | |
| if: >- | |
| github.event.workflow_run.event == 'pull_request' && | |
| github.event.workflow_run.conclusion == 'success' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download CI artifact | |
| if: github.event.workflow_run.name == 'CI' | |
| continue-on-error: true | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: coverage | |
| run-id: ${{ github.event.workflow_run.id }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download Benchmark artifact | |
| if: github.event.workflow_run.name == 'Benchmark' | |
| continue-on-error: true | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: benchmark | |
| run-id: ${{ github.event.workflow_run.id }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - id: pr | |
| run: echo "number=$(cat pr-number.txt)" >> "$GITHUB_OUTPUT" | |
| - name: Pytest coverage comment | |
| if: github.event.workflow_run.name == 'CI' | |
| uses: MishaKav/pytest-coverage-comment@v1 | |
| with: | |
| issue-number: ${{ steps.pr.outputs.number }} | |
| pytest-xml-coverage-path: ./coverage.xml | |
| junitxml-path: ./pytest.xml | |
| - name: Benchmark find comment | |
| if: github.event.workflow_run.name == 'Benchmark' | |
| uses: peter-evans/find-comment@v3 | |
| id: fc | |
| with: | |
| issue-number: ${{ steps.pr.outputs.number }} | |
| comment-author: "github-actions[bot]" | |
| body-includes: "Benchmark Results" | |
| - name: Benchmark create / update comment | |
| if: github.event.workflow_run.name == 'Benchmark' | |
| uses: peter-evans/create-or-update-comment@v5 | |
| with: | |
| comment-id: ${{ steps.fc.outputs.comment-id }} | |
| issue-number: ${{ steps.pr.outputs.number }} | |
| body-path: "benchmarks.md" | |
| edit-mode: replace |