Skip to content

Commit 7740e0f

Browse files
lalvareztclaude
andauthored
feat(ci): add manual baseline update workflow and update benchmark sizes (#12)
* feat(ci): add manual baseline update workflow and update benchmark sizes - Remove automatic baseline updates from benchmark.yml (main branch pushes) - Add new update-baseline.yml workflow for manual baseline updates - Trigger via workflow_dispatch with ref and iterations inputs - Checkout specified git ref (tag/branch/commit) - Run benchmarks and update baseline artifact - Update benchmark sizes from 100,1000,10000 to 1000,5000,10000 - Update iterations from 50 to 100 - Baseline updates now require explicit manual trigger via GitHub Actions UI * refactor(ci): lower upper bound --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent d264124 commit 7740e0f

File tree

2 files changed

+78
-10
lines changed

2 files changed

+78
-10
lines changed

.github/workflows/benchmark.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
run: |
3333
# Run benchmarks with multiple sizes and save to JSON
3434
./target/release/bench_throughput \
35-
--sizes 100,1000,10000 \
36-
--iterations 50 \
35+
--sizes 1000,5000,10000 \
36+
--iterations 100 \
3737
--format json \
3838
--output benchmark_results.json
3939
@@ -86,14 +86,6 @@ jobs:
8686
benchmark_results.json
8787
comparison.md
8888
89-
- name: Upload as baseline (main branch only)
90-
if: github.ref == 'refs/heads/main'
91-
uses: actions/upload-artifact@v4
92-
with:
93-
name: benchmark-baseline
94-
path: benchmark_results.json
95-
retention-days: 90
96-
9789
- name: Fail if significant performance regression
9890
if: steps.compare.outputs.comparison_available == 'true'
9991
run: |
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Update Benchmark Baseline
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: 'Git ref (tag, branch, or commit SHA) to benchmark'
8+
required: true
9+
default: 'main'
10+
type: string
11+
iterations:
12+
description: 'Number of benchmark iterations'
13+
required: false
14+
default: '100'
15+
type: string
16+
17+
jobs:
18+
update-baseline:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
23+
steps:
24+
- name: Checkout repository at specified ref
25+
uses: actions/checkout@v4
26+
with:
27+
ref: ${{ inputs.ref }}
28+
fetch-depth: 0
29+
30+
- name: Get commit info
31+
id: commit-info
32+
run: |
33+
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
34+
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
35+
echo "date=$(git log -1 --format=%ci)" >> $GITHUB_OUTPUT
36+
echo "message=$(git log -1 --format=%s)" >> $GITHUB_OUTPUT
37+
38+
- name: Install Rust toolchain
39+
uses: dtolnay/rust-toolchain@stable
40+
41+
- name: Cache Rust dependencies
42+
uses: Swatinem/rust-cache@v2
43+
44+
- name: Build benchmark tool
45+
run: cargo build --release --bin bench_throughput
46+
47+
- name: Run benchmarks
48+
run: |
49+
echo "Running benchmarks for commit ${{ steps.commit-info.outputs.short_sha }}"
50+
./target/release/bench_throughput \
51+
--sizes 1000,5000,10000 \
52+
--iterations ${{ inputs.iterations }} \
53+
--format json \
54+
--output benchmark_results.json
55+
56+
- name: Add workflow summary
57+
run: |
58+
echo "## Baseline Update Summary" >> $GITHUB_STEP_SUMMARY
59+
echo "" >> $GITHUB_STEP_SUMMARY
60+
echo "**Reference:** \`${{ inputs.ref }}\`" >> $GITHUB_STEP_SUMMARY
61+
echo "**Commit:** ${{ steps.commit-info.outputs.sha }}" >> $GITHUB_STEP_SUMMARY
62+
echo "**Date:** ${{ steps.commit-info.outputs.date }}" >> $GITHUB_STEP_SUMMARY
63+
echo "**Message:** ${{ steps.commit-info.outputs.message }}" >> $GITHUB_STEP_SUMMARY
64+
echo "" >> $GITHUB_STEP_SUMMARY
65+
echo "✅ Baseline has been updated successfully." >> $GITHUB_STEP_SUMMARY
66+
67+
- name: Upload new baseline
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: benchmark-baseline
71+
path: benchmark_results.json
72+
retention-days: 90
73+
74+
- name: Baseline updated successfully
75+
run: |
76+
echo "::notice::Baseline successfully updated to commit ${{ steps.commit-info.outputs.short_sha }}"

0 commit comments

Comments
 (0)