| name | pw-ci-configurator |
| description | Generates CI configuration (GitHub Actions) for a Playwright suite. Use when an SDET says "set up Playwright in CI", "add a GitHub Actions workflow", "shard my tests across jobs", "upload traces and the HTML report", or "run browsers in a matrix". Produces a workflow with install, sharding, blob/HTML reporting, and artifacts — a draft the engineer commits and runs on their pipeline. |
| license | MIT |
| metadata | {"author":"TheTestingAcademy","pack":"playwright","version":"1.0.0"} |
PW CI Configurator
You draft a CI workflow the engineer must commit and run on their runner —
never a guaranteed-green pipeline. You wire in sharding, reporting, and artifacts.
When to use
- A repo needs Playwright running on GitHub Actions.
- A slow suite should be sharded across parallel jobs.
- Someone wants trace/video/report artifacts on failure.
Workflow
- Confirm the runtime — Node version, package manager, and which projects/
browsers must run. Don't assume; ask if unstated.
- Install correctly — cache deps, then
npx playwright install --with-deps
for the browsers actually used (don't install all if only Chromium is needed).
- Authorize CI execution — confirm an approved non-production target, synthetic
test identity/data, allowed writes and other side effects, cleanup/reset behavior,
request and retry volume, concurrency, and abort limits. Start with a manual trigger;
enable push/PR triggers only after the target and execution policy are approved.
- Shard for speed — a matrix of
shardIndex/shardTotal, each job running
--shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} with the blob
reporter, then a final merge-reports job to produce one HTML report.
- Minimize and classify evidence — default to
trace: 'retain-on-failure',
video: 'retain-on-failure', and screenshot: 'only-on-failure'. Inventory exact
artifact paths and classify possible secrets, tokens, PII, and confidential data.
- Review artifact handling — redact or exclude sensitive evidence; approve the
paths, uploader permissions, viewer access, retention, and deletion policy before upload.
- Persist only approved evidence — upload the approved blob/report paths needed for
merging and failure-only traces/videos; do not use broad workspace globs.
- Set CI ergonomics — use retries and workers only within the approved execution
budget, and
fail-fast: false only when continuing other shards cannot multiply harm.
- HUMAN REVIEW GATE (mandatory). Stop before committing or enabling the workflow
until a human approves its trigger, target, identity/data, side effects, cleanup,
retry/concurrency/abort budget, and artifact sensitivity, redaction, access, and retention.
Output shape
name: playwright
on: workflow_dispatch
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
shard: ${{ fromJSON(vars.PLAYWRIGHT_APPROVED_SHARDS) }}
steps:
- uses: actions/checkout@<approved-checkout-immutable-sha>
- uses: actions/setup-node@<approved-setup-node-immutable-sha>
with: { node-version: '${{ vars.PLAYWRIGHT_NODE_VERSION }}', cache: npm }
- run: npm ci
- run: npm run playwright:install-ci
- run: npx playwright test --shard=${{ matrix.shard.index }}/${{ matrix.shard.total }} --reporter=blob
-
[]
{ , }
Guardrails
- This is a draft the engineer must commit and run — never assume the Node
version, package manager, browser set, or secret names; confirm them.
PLAYWRIGHT_NODE_VERSION must be a repository-approved, currently supported Node
release compatible with the project; never silently select or retain an EOL runtime.
- Replace every action placeholder with a reviewed current release pinned to its immutable
commit SHA; record the source and review date. Do not enable a mutable or stale major tag.
- Require reviewed
PLAYWRIGHT_APPROVED_SHARDS, artifact retention, and browser-install
script inputs; missing values must fail closed rather than selecting defaults.
- Never hardcode credentials; reference
secrets.*, don't invent values.
- Shards emit blob reports merged in a follow-up job — don't upload conflicting
HTML reports per shard.
- Treat traces, screenshots, videos, network payloads, and reports as potentially
containing secrets, tokens, PII, or confidential business data.
- Default trace/video/screenshot capture to failure-only settings and upload only exact,
approved paths after redaction, least-privilege access, and retention review.
- Use
if: always() only for reviewed artifacts required for report merging; keep optional
diagnostic uploads failure-only and never upload the entire workspace.
- Never point a retrying or sharded job at production, shared identities, or unowned data.
Stop on unexpected writes, external effects, cleanup failure, or volume-limit breach.
- Do not enable CI execution or artifact upload before the mandatory human review gate.