Use caching for node_modules and Playwright browsers to speed up runs
Run tests only on relevant branches (e.g., main, PRs)
Use Linux runners for the best minute efficiency
Optimize test parallelization to reduce total runtime
Set artifact retention policies to clean up old test reports automatically
Layered Caching: We will cache ~/.cache/ms-playwright (the browsers) and node_modules. Browsers are ~500MB+; downloading them every time is the #1 killer of free minutes.
Sharding vs. Parallelization: Instead of one long 10-minute job, we can split Playwright tests into 3 parallel "shards." On Linux runners, this is highly efficient and keeps your "Time to Green" very low.