From 193b5503b65f6df1e9b928ac00c1a3ccb590be87 Mon Sep 17 00:00:00 2001 From: Alejo Amiras Date: Tue, 18 Aug 2026 16:02:33 +0000 Subject: [PATCH] ci: gate PR benchmark job behind a benchmark-relevant paths filter Benchmark takes ~35 minutes and ran on every PR, docs-only included. A changes job (dorny/paths-filter, SHA-pinned v3.0.2) now gates it on paths that can affect benchmark output: contract sources, Nargo manifests, the benchmark definitions and their shared setup helpers, dependency manifests, and the workflow itself. Verified on a probe PR: with job-level gating a docs-only PR still gets a concluded run and the gated caller reports as a skipped 'benchmark' check. The nested 'benchmark / Benchmark' check is not created when skipped, so that exact context must not be listed as a required status check (see PR description for the required-checks implications). Co-Authored-By: Claude Fable 5 --- .github/workflows/pr-checks.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 394c2384..3053f025 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -8,6 +8,31 @@ concurrency: cancel-in-progress: true jobs: + # Job-level gating (not workflow-level `paths:`) so a skipped benchmark still + # reports as passing for branch protection. + changes: + name: Changes + runs-on: ubuntu-latest + permissions: + pull-requests: read + outputs: + benchmark: ${{ steps.filter.outputs.benchmark }} + steps: + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: filter + with: + filters: | + benchmark: + - 'src/**/*.nr' + - '**/Nargo.toml' + - 'benchmarks/**' + # every benchmark imports its setup helpers from this file + - 'src/ts/test/utils.ts' + - 'tsconfig.json' + - 'package.json' + - 'yarn.lock' + - '.github/workflows/pr-checks.yml' + format: name: Format runs-on: ubuntu-latest @@ -27,6 +52,10 @@ jobs: secrets: inherit benchmark: + # Skipping also skips this branch's baseline-artifact upload; a PR stacked on + # top of a skipped branch falls back to `if_no_artifact_found: warn` downstream. + needs: changes + if: needs.changes.outputs.benchmark == 'true' uses: AztecProtocol/aztec-benchmark/.github/workflows/pr-benchmark.yml@39244c9306f7b460aec570297100f3513f7ef936 # v5.0.1 with: runner: ubuntu-latest