Skip to content

Commit 009cae4

Browse files
authored
ci: fix cancelled queue for HH3 regression benchmark (#1506)
1 parent 3e4aacb commit 009cae4

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/hh3-regression-benchmark.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,20 @@ on:
2525
types: [created]
2626

2727
concurrency:
28-
# Group by PR (comment events) or ref (push/dispatch) so re-triggering `/bench`
28+
# Group by PR (comment events) or ref (dispatch) so re-triggering `/bench`
2929
# on a PR supersedes the previous run.
3030
#
31+
# Pushes to main are the exception: every commit must record its own baseline
32+
# entry, so each push gets a group keyed by commit SHA. `cancel-in-progress`
33+
# only protects the *in-progress* run, not runs *waiting* in the queue. A
34+
# unique-per-commit group collides with nothing, so every commit's run is
35+
# preserved and serialized by the self-hosted runner.
36+
#
3137
# Every comment triggers a workflow run. The job-level `if` skips non-`/bench`
3238
# ones, but that runs after concurrency is evaluated, so an unrelated comment
3339
# can cancel an in-progress benchmark. Give those skipped runs a unique group
3440
# so they collide with nothing.
35-
group: ${{ github.workflow }}-${{ github.event.issue.number || github.ref }}${{ (github.event_name == 'issue_comment' && !startsWith(github.event.comment.body, '/bench')) && format('-skip-{0}', github.run_id) || '' }}
41+
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.event.issue.number || github.ref }}${{ (github.event_name == 'issue_comment' && !startsWith(github.event.comment.body, '/bench')) && format('-skip-{0}', github.run_id) || '' }}
3642
# Don't cancel in-progress baseline runs on main so baselines aren't lost.
3743
cancel-in-progress: ${{ github.event_name != 'push' }}
3844

0 commit comments

Comments
 (0)