Skip to content
Merged
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
11 changes: 7 additions & 4 deletions .github/workflows/bench-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ jobs:

steps:
- uses: actions/checkout@v6
id: checkout
with:
# Full history so the script can git-archive the base branch.
fetch-depth: 0
ref: ${{ github.head_ref }}
# Use the PR head SHA so fork PRs resolve correctly
# (github.head_ref is a branch name that only exists on the fork remote).
ref: ${{ github.event.pull_request.head.sha }}

- uses: wyvox/action-setup-pnpm@v3

Expand All @@ -33,19 +36,19 @@ jobs:
pnpm bench:compare | sed 's/\x1b\[[0-9;]*m//g' > "$RUNNER_TEMP/bench-output.txt"

- name: Format PR comment
if: always()
if: always() && steps.checkout.outcome == 'success'
env:
BENCH_OUTPUT_FILE: ${{ runner.temp }}/bench-output.txt
BENCH_JSON_OUTPUT: ${{ runner.temp }}/bench-results.json
BENCH_JOB_SUCCESS: ${{ job.status == 'success' }}
run: node scripts/format-bench-comment.mjs > "$RUNNER_TEMP/bench-comment.md"

- name: Write job summary
if: always()
if: always() && steps.checkout.outcome == 'success'
run: cat "$RUNNER_TEMP/bench-comment.md" >> "$GITHUB_STEP_SUMMARY"

- name: Post PR comment
if: always()
if: always() && steps.checkout.outcome == 'success'
uses: actions/github-script@v7
with:
script: |
Expand Down
Loading