
Playwright Ci Caching
If you're running Playwright tests in CI, you're probably wasting 1-2 minutes per build downloading 400MB of browser binaries. This skill shows you how to cache them properly in GitHub Actions and Azure DevOps, with the cache key tied to your Playwright version from Directory.Packages.props so it automatically invalidates when you upgrade. The included playwright.ps1 helper script is clever because it discovers the Playwright CLI location regardless of your project structure, saving you from hardcoding paths that break. Battle-tested in production at Petabridge. The setup is straightforward and the time savings add up fast across dozens of CI runs.
- skills.sh installs
- 455
- GitHub stars
- 1.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add aaronontheweb/dotnet-skills --skill playwright-ci-caching --agent claude-codeInstalls into .claude/skills of the current project.
Files
Caching Playwright Browsers in CI/CD
When to Use This Skill
Use this skill when:
- Setting up CI/CD for a project with Playwright E2E tests
- Build times are slow due to browser downloads (~400MB, 1-2 minutes)
- You want automatic cache invalidation when Playwright version changes
- Using GitHub Actions or Azure DevOps pipelines
The Problem
Playwright browsers (~400MB) must be downloaded on every CI run by default. This:
- Adds 1-2 minutes to every build
- Wastes bandwidth
- Can fail on transient network issues
- Slows down PR feedback loops
Core Pattern
- Extract Playwright version from
Directory.Packages.props(CPM) to use as cache key - Cache browser binaries using platform-appropriate paths
- Conditional install - only download on cache miss
- Automatic cache bust - key includes version, so package upgrades invalidate cache
Cache Paths by OS
| OS | Path |
|---|---|
| Linux | ~/.cache/ms-playwright |
| macOS | ~/Library/Caches/ms-playwright |
| Windows | %USERPROFILE%\AppData\Local\ms-playwright |
GitHub Actions
Sponsors
Details
- Repository
- github.com/aaronontheweb/dotnet-skills
- Categories
- Testing & QA, DevOps & CI/CD, Git & Pull Requests, Automation & Workflows, Cloud & Infrastructure, .NET & C#
- First seen
- Jun 3, 2026
More from aaronontheweb/dotnet-skills
All 34- Akka Net Best Practices451
- Mailpit Integration443
- Verify Email Snapshots436
- Akka Hosting Actor Patterns434
- Akka Net Testing Patterns431
- OpenTelemetry NET Instrumentation431
- Akka Net Management430
- Akka Net Aspire Configuration415
- Marketplace Publishing408
- Modern Csharp Coding Standards2.3K
- Csharp Concurrency Patterns1.6K
- Efcore Patterns1.6K
- Dependency Injection Patterns703
- Database Performance700
- Dotnet Project Structure692
- Api Design690
- Type Design Performance684
- Ilspy Decompile640
- Package Management613
- Microsoft Extensions Configuration609
- Serialization596
- Crap Analysis581
- Dotnet Slopwatch580
- Testcontainers Integration Tests579