Skip to content

Commit 82218fb

Browse files
committed
[libc++] Use the correct pull-request base and targets for the benchmarking job
1 parent b64ed9d commit 82218fb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/libcxx-run-benchmarks.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ on:
2121
env:
2222
CC: clang-22
2323
CXX: clang++-22
24-
COMMENT_BODY: ${{ github.event.comment.body }}
24+
COMMENT_BODY: ${{ github.event.comment.body }}
25+
PULL_REQUEST_HEAD: ${{ github.event.issue.pull_request.head.sha }}
26+
PULL_REQUEST_BASE: ${{ github.event.issue.pull_request.base.sha }}
2527

2628
jobs:
2729
run-benchmarks:
@@ -33,6 +35,7 @@ jobs:
3335
steps:
3436
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3537
with:
38+
ref: ${PULL_REQUEST_HEAD}
3639
fetch-depth: 0
3740
fetch-tags: true # This job requires access to all the Git branches so it can diff against (usually) main
3841

@@ -49,13 +52,13 @@ jobs:
4952
- name: Run baseline
5053
run: |
5154
BENCHMARKS=$(echo "${COMMENT_BODY}" | sed -nE 's/\/libcxx-bot benchmark (.+)/\1/p')
52-
baseline_commit=$(git merge-base refs/remotes/origin/${GITHUB_BASE_REF} ${GITHUB_SHA})
55+
baseline_commit=$(git merge-base ${PULL_REQUEST_BASE} ${PULL_REQUEST_SHA})
5356
./libcxx/utils/test-at-commit --commit ${baseline_commit} -B build/baseline -- -sv -j1 --param optimization=speed ${BENCHMARKS}
5457
5558
- name: Run candidate
5659
run: |
5760
BENCHMARKS=$(echo "${COMMENT_BODY}" | sed -nE 's/\/libcxx-bot benchmark (.+)/\1/p')
58-
./libcxx/utils/test-at-commit --commit ${GITHUB_SHA} -B build/candidate -- -sv -j1 --param optimization=speed ${BENCHMARKS}
61+
./libcxx/utils/test-at-commit --commit ${PULL_REQUEST_SHA} -B build/candidate -- -sv -j1 --param optimization=speed ${BENCHMARKS}
5962
6063
- name: Compare baseline and candidate runs
6164
run: ./libcxx/utils/compare-benchmarks <(./libcxx/utils/consolidate-benchmarks build/baseline) \

0 commit comments

Comments
 (0)