Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Comment PR"
run-name: "${{ format('Comment PR #{0}', github.event.pull_request.number) }}"

on:
pull_request_target:

permissions:
pull-requests: "write"
contents: "read"

env:
GIT_CONFIG_GLOBAL: "/root/.gitconfig" # fix path in container (https://github.com/actions/runner/issues/2033)

jobs:

perf-report:
runs-on: "ubuntu-latest"

steps:
- name: "Wait for performance job to succeed"
uses: "fountainhead/action-wait-for-check@v1.2.0"
id: "wait-for-perf"
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: "test / performance"
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- if: steps.wait-for-perf.outputs.conclusion != 'success'
run: |
echo "Perf tests job failed, stopping workflow."
exit 1

- name: "Download benchmark report"
uses: "dawidd6/action-download-artifact@v11"
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
commit: "${{ github.event.pull_request.head.sha }}"
if_no_artifact_found: "fail"
workflow: "ci.yml"
workflow_conclusion: "" # to ignore status or conclusion in the search
allow_forks: true # searching artifact in forks
name: "perf-report"
path: "./"

- uses: "mshick/add-pr-comment@v2"
with:
message-path: "performance-report.md"
message-id: "perf-report-pr-${{ github.event.pull_request.number }}"
refresh-message-position: true
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
### PERFORMANCE ###

performance:
name: "performance"
runs-on: "ubuntu-latest"
env:
BENCH_MASTER_ARTIFACT_KEY: "bench-master"
Expand Down Expand Up @@ -98,12 +99,11 @@ jobs:

cat performance-report.md >> $GITHUB_STEP_SUMMARY

- uses: "mshick/add-pr-comment@v2"
if: "${{ github.event_name == 'pull_request' }}"
- name: "Upload perf comparison report as artifact"
uses: "actions/upload-artifact@v4"
with:
message-path: "performance-report.md"
message-id: "perf-report-pr-${{ github.event.pull_request.number }}"
refresh-message-position: true
name: "perf-report"
path: "performance-report.md"

- name: "Prepare master benchmark info for uploading as artifact"
if: "${{ github.ref_name == github.event.repository.default_branch }}"
Expand Down