From 30985ef5aa5b6b113d9c3977d8f097ad425eea07 Mon Sep 17 00:00:00 2001 From: hoodiehuuuuu Date: Wed, 20 Aug 2025 18:02:54 +0300 Subject: [PATCH 1/3] new workflow for commenting pr * fix pr commenting * repo-settings --------- Co-authored-by: Georgy Shpilevoy --- .github/workflows/pr-comment.yml | 48 ++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 10 +++---- 2 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/pr-comment.yml diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml new file mode 100644 index 0000000..7043734 --- /dev/null +++ b/.github/workflows/pr-comment.yml @@ -0,0 +1,48 @@ +name: "Comment PR" + +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: + + add-comment: + 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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a896e24..ee5b09c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,6 +63,7 @@ jobs: ### PERFORMANCE ### performance: + name: "performance" runs-on: "ubuntu-latest" env: BENCH_MASTER_ARTIFACT_KEY: "bench-master" @@ -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 }}" From 4d0e8c308c94c311bc35c618c1a6dd0aeccbdb3a Mon Sep 17 00:00:00 2001 From: Georgy Shpilevoy Date: Wed, 20 Aug 2025 19:38:22 +0300 Subject: [PATCH 2/3] change workflow name --- .github/workflows/pr-comment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml index 7043734..8a2c4b1 100644 --- a/.github/workflows/pr-comment.yml +++ b/.github/workflows/pr-comment.yml @@ -1,4 +1,5 @@ name: "Comment PR" +run-name: "${{ format('Comment PR #{0}', github.event.pull_request.number)) }}" on: pull_request_target: @@ -12,7 +13,7 @@ env: jobs: - add-comment: + perf-report: runs-on: "ubuntu-latest" steps: From 21e30cc6c4ba77dd1db79751c0205cb520bb3387 Mon Sep 17 00:00:00 2001 From: Georgy Shpilevoy Date: Wed, 20 Aug 2025 19:44:05 +0300 Subject: [PATCH 3/3] syntax fix --- .github/workflows/pr-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml index 8a2c4b1..5035688 100644 --- a/.github/workflows/pr-comment.yml +++ b/.github/workflows/pr-comment.yml @@ -1,5 +1,5 @@ name: "Comment PR" -run-name: "${{ format('Comment PR #{0}', github.event.pull_request.number)) }}" +run-name: "${{ format('Comment PR #{0}', github.event.pull_request.number) }}" on: pull_request_target: