diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index c66b467222..42fa577c2d 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -1,6 +1,10 @@ name: Bench on: workflow_call: + outputs: + results: + description: 'Benchmark results formatted as Markdown' + value: ${{ jobs.bench.outputs.results }} workflow_dispatch: env: CARGO_PROFILE_BENCH_BUILD_OVERRIDE_DEBUG: true @@ -15,8 +19,8 @@ jobs: bench: name: Benchmark runs-on: self-hosted - permissions: - pull-requests: write + outputs: + results: ${{ steps.results.outputs.results }} defaults: run: shell: bash @@ -130,6 +134,7 @@ jobs: compression-level: 9 - name: Format results as Markdown + id: results run: | grep -Ev 'ignored|running \d+ tests|%\)' output.txt |\ sed -E -e 's/(Performance has regressed.)/:broken_heart: **\1**/gi' \ @@ -140,10 +145,4 @@ jobs: > results.md echo '' >> results.md echo '[:arrow_down: Download full results](${{ steps.export.outputs.artifact-url }})' >> results.md - - - name: Post results to PR - uses: thollander/actions-comment-pull-request@v2 - with: - filePath: results.md - pr_number: ${{ github.event.pull_request.number }} - comment_tag: bench-results + echo "results='$(cat results.md)'" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index fc6eb0c284..2be20c4ffd 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -155,7 +155,16 @@ jobs: bench: name: "Benchmark" - needs: [check] - permissions: - pull-requests: write + # needs: [check] uses: ./.github/workflows/bench.yml + + pr-comment: + name: "Post results to PR" + needs: [bench] + runs-on: ubuntu-latest + steps: + - uses: thollander/actions-comment-pull-request@v2 + with: + message: ${{ needs.bench.outputs.results }} + pr_number: ${{ github.event.pull_request.number }} + comment_tag: bench-results