Skip to content

Commit d44baf6

Browse files
authored
only run codspeed benchmarks on PRs labelled 'benchmark' (zarr-developers#3673)
* only run codspeed benchmarks on PRs labelled 'benchmark' * changelog * rename changelog
1 parent 20d04d2 commit d44baf6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.github/workflows/codspeed.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- "main"
77
pull_request:
8+
types: [labeled, synchronize]
89
# `workflow_dispatch` allows CodSpeed to trigger backtest
910
# performance analysis in order to generate initial data.
1011
workflow_dispatch:
@@ -16,6 +17,11 @@ jobs:
1617
benchmarks:
1718
name: Run benchmarks
1819
runs-on: codspeed-macro
20+
# Only run benchmarks for: pushes to main, manual triggers, or PRs with 'benchmark' label
21+
if: |
22+
github.event_name == 'push' ||
23+
github.event_name == 'workflow_dispatch' ||
24+
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark'))
1925
steps:
2026
- uses: actions/checkout@v6
2127
with:

changes/3673.misc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Benchmark CI now only runs for PRs with the `benchmark` label, reducing CodSpeed credit usage.

0 commit comments

Comments
 (0)