10. CI, artifacts, and ownership
Test Automation · 48 pages source format
Tests that only run on your laptop are hobbies. Wire CI, fail loud with traces/videos, and assign owners to red builds.
What you'll learn
- PR checks
- Artifacts in CI
- Flake budgets
Run on every PR
GitHub Actions on pull_request. Keep smoke fast (<10 min) so people do not skip.
name: UI Tests
on: [pull_request, push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci && npx playwright install --with-deps
- run: npx playwright test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-results
path: test-results/Do this now
Add a workflow that runs your suite and uploads artifacts on failure.
Own the red
Dashboards without owners are wallpaper. Define who triages within 24h.
Do this now
Write a 5-line “red build ritual” for your team (even if the team is just you).
Flake budget
Allow 0–2% flake rate. Above that, stop adding tests until stability improves.
Do this now
Track last 20 CI runs. Count flakes. If >1, list top 3 suspects in FLAKES.md.
Branch protection
Required status checks on main prevent merging broken code. Configure when you have a green baseline.
Do this now
Enable required check for your test workflow on main (or document plan if solo).