|
| 1 | +name: PR Agent Bench |
| 2 | + |
| 3 | +# Thin CALLER for the per-PR LLM-agent benchmark. This workflow owns the |
| 4 | +# triggers and the same-repo (fork) gate; the bench matrix + summary live in |
| 5 | +# the reusable workflow .github/workflows/agent-bench.yml, invoked below so |
| 6 | +# GitHub renders a nested check hierarchy: PR Agent Bench / bench / <cell>. |
| 7 | +# |
| 8 | +# Required configuration (publish environment, consumed inside agent-bench.yml): |
| 9 | +# AWS_ROLE_ARN secret OIDC role with bedrock:InvokeModelWithResponseStream |
| 10 | +# on the bench model, plus s3:PutObject on bench/* in |
| 11 | +# the registry bucket (per-cell archive + the commit- |
| 12 | +# keyed baseline aggregate). Reading the baseline back |
| 13 | +# for the PR-vs-baseline overview also needs |
| 14 | +# s3:GetObject on bench/* — if the role lacks it the |
| 15 | +# overview simply degrades to "no baseline" (never an |
| 16 | +# error). See agent-bench.yml. |
| 17 | +# S3_BUCKET variable Registry bucket (existing). |
| 18 | + |
| 19 | +on: |
| 20 | + # Runs unconditionally on same-repo PR open/update AND on every push to main |
| 21 | + # (a main run records the merged commit's baseline for later PRs to diff |
| 22 | + # against). There is NO label gate: the bench is green-regardless — a failed |
| 23 | + # cell / agent-timeout lands in the run summary, not the check status — so it |
| 24 | + # is safe to run on every commit. Fork PRs get no secrets/OIDC under |
| 25 | + # `pull_request` and are additionally blocked by the same-repo `if` below. |
| 26 | + pull_request: |
| 27 | + types: [opened, synchronize, reopened] |
| 28 | + push: |
| 29 | + branches: [main] |
| 30 | + workflow_dispatch: |
| 31 | + |
| 32 | +concurrency: |
| 33 | + # A new commit cancels the prior in-flight run for the same PR (keyed by PR |
| 34 | + # number) or branch (keyed by github.ref, e.g. push to main). github.ref — |
| 35 | + # NOT run_id — is what makes cancel-in-progress actually cancel: run_id is |
| 36 | + # unique per run, so the old group never collided and nothing was cancelled. |
| 37 | + group: agent-bench-${{ github.event.pull_request.number || github.ref }} |
| 38 | + cancel-in-progress: true |
| 39 | + |
| 40 | +permissions: |
| 41 | + contents: read |
| 42 | + |
| 43 | +jobs: |
| 44 | + bench: |
| 45 | + # Same-repo gate (and manual dispatch) lives HERE, on the calling job -- a |
| 46 | + # `uses:` job may carry `if:`/`permissions`. The OIDC steps and |
| 47 | + # `environment: publish` stay inside the reusable workflow (a calling job |
| 48 | + # cannot set `environment`). Fork PRs get no secrets/OIDC under |
| 49 | + # `pull_request`, but defense-in-depth: also gate on same-repo. Push to main |
| 50 | + # is same-repo by definition. Mirrors pr-checks.yml. |
| 51 | + if: >- |
| 52 | + github.event_name == 'workflow_dispatch' || |
| 53 | + github.event_name == 'push' || |
| 54 | + (github.event_name == 'pull_request' && |
| 55 | + github.event.pull_request.head.repo.full_name == github.repository) |
| 56 | + # Union token so the reusable workflow's per-job permissions resolve: both |
| 57 | + # bench and summary narrow to id-token:write (OIDC -> Bedrock + S3) + |
| 58 | + # contents:read. No pull-requests:write — the bench posts no PR comment |
| 59 | + # (the scoreboard is the Actions run summary). |
| 60 | + permissions: |
| 61 | + id-token: write |
| 62 | + contents: read |
| 63 | + uses: ./.github/workflows/agent-bench.yml |
| 64 | + secrets: inherit |
0 commit comments