Skip to content

fix: address Phase 2 review findings from #1819 #2294

fix: address Phase 2 review findings from #1819

fix: address Phase 2 review findings from #1819 #2294

name: Benchmark Regression Gate
on:
pull_request:
types: [synchronize, opened, reopened]
jobs:
benchmark:
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: benchmark-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: |
package-lock.json
package-lock.json
# Route through the shared wrapper so the MCP install inherits the
# Playwright browser-download skip (promptfoo's optional
# @playwright/browser-chromium otherwise wedges `npm ci` past the cap on a
# cold runner) plus retry/timeout resilience. A plain `npm ci` here
# bypassed both. See docs/rca/2026-05-31-npm-ci-playwright-browser-wedge.md.
- name: Install dependencies
run: bash "$GITHUB_WORKSPACE/tools/release/npm-ci-retry.sh"
- name: Run benchmarks
run: npm run bench -- --outputJson benchmark-results.json
env:
RUN_BENCHMARKS: 'true'
- name: Upload benchmark results
uses: actions/upload-artifact@v4
if: always()
with:
name: benchmark-results
path: benchmark-results.json
retention-days: 7
- name: Check for regressions
continue-on-error: true
run: bash tools/audit/gates/check-benchmark-regression.sh --results benchmark-results.json --baselines src/projections/telemetry/benchmarks/baselines.json