Skip to content

Commit 264e992

Browse files
committed
add CI perf-bench job to run short filtered benchmarks on PRs
1 parent 5144a8a commit 264e992

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,41 @@ jobs:
6161
uses: github/codeql-action/autobuild@v3
6262
- name: Analyze with CodeQL
6363
uses: github/codeql-action/analyze@v3
64+
perf-bench:
65+
if: github.actor != 'dependabot[bot]'
66+
needs: build
67+
runs-on: windows-latest
68+
timeout-minutes: 15
69+
70+
steps:
71+
- uses: actions/checkout@v4
72+
- uses: actions/setup-dotnet@v4
73+
with:
74+
dotnet-version: '8.0.x'
75+
76+
# 🔎 Short, filtered, noise-gated run with a compact CI summary
77+
- name: Run perf benchmarks (short)
78+
shell: pwsh
79+
run: >
80+
pwsh -NoProfile -File bench/Run-Benchmarks.ps1
81+
-Job Short
82+
-Filter *Redaction* # narrow to the benches you care about on PRs
83+
-MaxStdevPct 12 # fail if StdDev/Mean > 12% for any benchmark
84+
-Ci
85+
86+
- name: Upload benchmark artifacts
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: perf-benchmarks
90+
path: artifacts/benchmarks
91+
if-no-files-found: error
92+
93+
- name: Publish benchmark summary to PR
94+
shell: pwsh
95+
run: |
96+
$f = Get-ChildItem "artifacts/benchmarks/*/SUMMARY.md" -ErrorAction SilentlyContinue |
97+
Sort-Object LastWriteTime -Descending | Select-Object -First 1
98+
if ($f) { Get-Content $f.FullName | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8 }
6499
65100
# --- Optional companion gates (disabled by default) ---
66101
# - name: Unrecorded HTTP Call gate

0 commit comments

Comments
 (0)