Context
Surfaced during review of #354. Both .github/workflows/ci.yml (11 jobs) and .github/workflows/ci-results-repo.yml (11 jobs) duplicate the same setup boilerplate across each tool's job: actions/checkout, actions/setup-node, npm ci, npm run build, Run benchmark, fetch gh-pages step (in ci.yml), Store benchmark result invocation, validate command. The two files differ only by:
gh-repository input on the action (results-repo case)
- Validate-script third arg (
./benchmark-data-repository)
- Token used (default
GITHUB_TOKEN vs BENCHMARK_ACTION_BOT_TOKEN)
22 jobs share ~80% of their YAML.
Problem
Proposal
Two paths, pick one:
- Composite action at
.github/actions/setup-bench/action.yml — wraps actions/checkout, setup-node, npm ci, npm run build. Each job calls uses: ./.github/actions/setup-bench then runs its tool-specific Run benchmark step plus Store benchmark result.
workflow_call reusable workflow with matrix over (tool, target_repo). Single source of truth; a tool value selects which benchmark-runner step to use; target_repo selects gh-repository / token / validate-arg.
(2) collapses both YAML files into one. Bigger refactor but eliminates the file split entirely.
Out of scope
Acceptance
- ci.yml + ci-results-repo.yml shrink ~70%.
- Adding a new benchmark tool requires ≤1 job entry, not ≥2.
- All existing 22 jobs continue to pass.
Context
Surfaced during review of #354. Both
.github/workflows/ci.yml(11 jobs) and.github/workflows/ci-results-repo.yml(11 jobs) duplicate the same setup boilerplate across each tool's job:actions/checkout,actions/setup-node,npm ci,npm run build,Run benchmark, fetch gh-pages step (in ci.yml),Store benchmark resultinvocation, validate command. The two files differ only by:gh-repositoryinput on the action (results-repo case)./benchmark-data-repository)GITHUB_TOKENvsBENCHMARK_ACTION_BOT_TOKEN)22 jobs share ~80% of their YAML.
Problem
Save previous data.js× 22, plus add fetch step × 11). Future similar changes will keep paying the same tax.Proposal
Two paths, pick one:
.github/actions/setup-bench/action.yml— wrapsactions/checkout,setup-node,npm ci,npm run build. Each job callsuses: ./.github/actions/setup-benchthen runs its tool-specificRun benchmarkstep plusStore benchmark result.workflow_callreusable workflow with matrix over(tool, target_repo). Single source of truth; atoolvalue selects which benchmark-runner step to use;target_reposelects gh-repository / token / validate-arg.(2) collapses both YAML files into one. Bigger refactor but eliminates the file split entirely.
Out of scope
Acceptance