Skip to content

Commit e541a36

Browse files
committed
fix: correct Bencher integration for baseline tracking
1 parent a53baef commit e541a36

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.github/workflows/benchmarks.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
name: Benchmarks
22

3-
# Runs benchmarks on-demand (manual dispatch) to track performance
4-
# and detect regressions in the Event Scanner.
3+
# Runs benchmarks to track performance and detect regressions.
4+
# - On push to main: automatically updates baseline in Bencher
5+
# - On manual dispatch: run specific benchmarks on-demand
56

67
on:
8+
push:
9+
branches: [main]
10+
paths:
11+
# Only run benchmarks if relevant code changes
12+
- "src/**"
13+
- "benches/**"
14+
- "Cargo.toml"
15+
- "Cargo.lock"
716
workflow_dispatch:
817
inputs:
918
benchmark:
@@ -28,7 +37,8 @@ jobs:
2837
benchmark_historic:
2938
name: Run Historic Benchmarks
3039
runs-on: ubuntu-latest
31-
if: ${{ inputs.benchmark == 'all' || inputs.benchmark == 'historic_scanning' }}
40+
# Run on push to main, or when manually selecting 'all' or 'historic_scanning'
41+
if: ${{ github.event_name == 'push' || inputs.benchmark == 'all' || inputs.benchmark == 'historic_scanning' }}
3242

3343
steps:
3444
- name: Harden the runner (Audit all outbound calls)
@@ -82,7 +92,8 @@ jobs:
8292
benchmark_latest:
8393
name: Run Latest Events Benchmarks
8494
runs-on: ubuntu-latest
85-
if: ${{ inputs.benchmark == 'all' || inputs.benchmark == 'latest_events_scanning' }}
95+
# Run on push to main, or when manually selecting 'all' or 'latest_events_scanning'
96+
if: ${{ github.event_name == 'push' || inputs.benchmark == 'all' || inputs.benchmark == 'latest_events_scanning' }}
8697

8798
steps:
8899
- name: Harden the runner (Audit all outbound calls)

.github/workflows/pr_benchmarks_track.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@ jobs:
7676
--adapter rust_criterion \
7777
--github-actions "${{ secrets.GITHUB_TOKEN }}" \
7878
--ci-number "$PR_NUMBER" \
79+
--ci-only \
7980
--file "$BENCHMARK_RESULTS"

0 commit comments

Comments
 (0)