diff --git a/.github/workflows/comment-perf.yaml b/.github/workflows/comment-perf.yaml index a6ad2e02..075d3611 100644 --- a/.github/workflows/comment-perf.yaml +++ b/.github/workflows/comment-perf.yaml @@ -20,14 +20,18 @@ jobs: - name: Download comment uses: actions/download-artifact@v4 with: - name: benchmark-report - path: benchmark-report.txt + name: benchmark-result + path: benchmark-result github-token: ${{ secrets.ROCKSBOT_CHISEL_PR_COMMENTER }} run-id: ${{ github.event.workflow_run.id }} + - name: Read PR number + id: read-pr-number + run: echo "number=$(cat benchmark-result/pr_number)" >> $GITHUB_OUTPUT + - name: Post message to PR - uses: mshick/add-pr-comment@dd126dd8c253650d181ad9538d8b4fa218fc31e8 + uses: mshick/add-pr-comment@dd126dd8c253650d181ad9538d8b4fa218fc31e8 # v2 with: - message-path: benchmark-report.txt - issue: ${{ github.event.workflow_run.pull_requests[0].number }} + message-path: benchmark-result/report.md + issue: ${{ steps.read-pr-number.outputs.number }} repo-token: ${{ secrets.ROCKSBOT_CHISEL_PR_COMMENTER }} diff --git a/.github/workflows/performance.yaml b/.github/workflows/performance.yaml index 1d9c7063..a79bf1b6 100644 --- a/.github/workflows/performance.yaml +++ b/.github/workflows/performance.yaml @@ -65,14 +65,17 @@ jobs: - name: Run benchmark id: benchmark run: | - msg_file="$(mktemp)" - echo "msg_file=$msg_file" >> $GITHUB_OUTPUT chmod +x base head - hyperfine --export-markdown "$msg_file" "./base info --release ./chisel-releases 'python3.12_core'" -n "BASE" "./head info --release ./chisel-releases 'python3.12_core'" -n "HEAD" + hyperfine --export-markdown report.md "./base info --release ./chisel-releases 'python3.12_core'" -n "BASE" "./head info --release ./chisel-releases 'python3.12_core'" -n "HEAD" + + - name: Save PR number + run: echo "${{ github.event.pull_request.number }}" > pr_number - name: Upload result uses: actions/upload-artifact@v4 with: - name: benchmark-report - path: ${{ steps.benchmark.outputs.msg_file }} + name: benchmark-result + path: | + report.md + pr_number retention-days: 1