9. CI, parallelization, and artifacts
Cypress · 48 pages source format
Cypress in GitHub Actions with video/screenshot upload, caching, and optional Cypress Cloud parallelism. Retries are signal — not normalized flake acceptance.
What you'll learn
- cypress-io/github-action
- Artifact upload
- Retries config
- Record key optional
GitHub Actions workflow
Use cypress-io/github-action for install, cache, run, and artifact upload in one step.
name: Cypress
on: [push, pull_request]
jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cypress-io/github-action@v6
with:
browser: chrome
config-file: cypress.config.jsDo this now
Add .github/workflows/cypress.yml. Green run on push to main.
Artifacts on failure
Videos and screenshots upload automatically with github-action when configured. Verify download works.
Do this now
Break a test on a branch. Confirm CI uploads artifacts. Fix and merge.
Retries in config
retries: { runMode: 2 } in CI only — flakes get second chance; chronic flakes still get fixed.
Do this now
Configure retries for runMode. Document flake budget in FLAKES.md.
Parallel shards (awareness)
Cypress Cloud or manual matrix splits specs across machines. Know the concept for interviews even if solo project skips it.
Do this now
Read Cypress parallelization docs. Write 2 sentences in README on how you would shard 50 specs.