playwright-ci-caching

Automates version-aware caching of Playwright browser binaries for CI/CD pipelines.

1.1k|101|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill playwright-ci-caching
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-ci-caching
Source: https://github.com/Aaronontheweb/dotnet-skills/tree/main/skills/playwright-ci-caching
Command: npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill playwright-ci-caching

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cache Playwright browser binaries in CI/CD pipelines to avoid 1-2 minute downloads per build, improving PR feedback times and reliability.

Core Features & Use Cases

  • Version-aware caching: derives the Playwright version from Directory.Packages.props to form a cache key that busts automatically on upgrades.
  • OS-specific cache paths: caches browsers to the appropriate paths per OS (Linux, macOS, Windows).
  • Conditional install: only downloads binaries when a cache miss is detected, reducing CI time and flakiness.
  • CI platform support: designed for GitHub Actions and Azure DevOps pipelines in .NET projects.

Quick Start

Install or verify browsers in CI with:

  • ./build/playwright.ps1 install --with-deps
  • ./build/playwright.ps1 install chromium
  • ./build/playwright.ps1 install --dry-run

Frequently Asked Questions about playwright-ci-caching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I cache Playwright browsers in GitHub Actions to speed up CI builds?

To cache Playwright browsers in GitHub Actions, use a PowerShell helper script that extracts the Playwright version from Directory.Packages.props to generate a cache key. This invalidates the cache on upgrades and only downloads binaries on cache misses.

Why does my Playwright CI pipeline download browsers on every single build?

Your Playwright CI pipeline downloads browsers every build because it lacks a version-aware cache key. Deriving the cache key from Directory.Packages.props ensures browsers are cached and only re-downloaded when the Playwright version upgrades.

Can I use this Playwright caching approach with Azure DevOps and .NET projects?

Yes, this Playwright caching approach supports Azure DevOps and .NET projects. It targets both GitHub Actions and Azure DevOps pipelines, utilizing OS-specific cache paths for Linux, macOS, and Windows to store browser binaries.

What is the best way to invalidate a Playwright browser cache in CI when upgrading?

The best way to invalidate a Playwright browser cache in CI is to derive the cache key from the Playwright version in Directory.Packages.props. This automatically busts the cache when you upgrade the Playwright package version in your .NET project.

Does caching Playwright binaries work across different operating systems in CI/CD?

Yes, caching Playwright binaries works across operating systems in CI/CD by using per-OS cache paths. The skill implements specific cache paths for Linux, macOS, and Windows to ensure browsers are stored and retrieved correctly on each platform.