Skip to content

Commit 94d1fd6

Browse files
committed
gh-action: allow manual bench run with filter
The bench workflow can now be run manually with an optional criterion filter and optional git ref. This way, specific benchmarks can be run for specific commits and compard. The github CLI tool is a convenient way to start manual runs.
1 parent f63c8d7 commit 94d1fd6

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/bench.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ on:
44
push:
55
branches:
66
- "main"
7+
workflow_dispatch:
8+
inputs:
9+
filter:
10+
description: 'Optional filter for cargo bench (e.g., a specific benchmark name)'
11+
default: ''
12+
required: false
13+
ref:
14+
description: 'Optional git ref to benchmark'
15+
default: ''
16+
required: false
717

818
jobs:
919
benchmarks:
@@ -13,6 +23,7 @@ jobs:
1323
uses: actions/checkout@v4
1424
with:
1525
submodules: recursive
26+
ref: ${{ github.event.inputs.ref }}
1627
- name: Install nightly
1728
uses: dtolnay/rust-toolchain@master
1829
id: toolchain
@@ -32,9 +43,9 @@ jobs:
3243
bencher run \
3344
--project cryprot \
3445
--token '${{ secrets.BENCHER_API_TOKEN }}' \
35-
--branch main \
46+
--branch '${{github.ref_name}}' \
3647
--testbed ubicloud-standard-4 \
3748
--threshold-measure latency \
3849
--threshold-test t_test \
3950
--threshold-upper-boundary 0.99 \
40-
'cargo bench'
51+
'cargo bench ${{ github.event.inputs.filter }}'

0 commit comments

Comments
 (0)