Repository navigation
Add the playwright module: cached browsers, and system packages with a .deb cache only main saves - #60
Open
ndbroadbent wants to merge 4 commits into
Open
Add the playwright module: cached browsers, and system packages with a .deb cache only main saves#60ndbroadbent wants to merge 4 commits into
ndbroadbent wants to merge 4 commits into
Conversation
`modules: [node]` installs the Node the project pins and its package manager, runs a frozen install and caches the package manager's downloads, on GitHub Actions and CircleCI. - Node's version: .nvmrc or .node-version in `path`, else at the root, else package.json's engines.node, else `version:` (or `preinstalled`). On CircleCI the job's image must be a node/cimg/node image matching the pinned version. - Package manager: package.json's packageManager, else the one lockfile present. pnpm and Yarn go through pnpm/action-setup or Corepack. - Install: npm ci, pnpm install --frozen-lockfile, yarn install --immutable (Berry) or --frozen-lockfile (Classic). - Cache: setup-node's cache keyed on the lockfile on GitHub; restore_cache/save_cache keyed on the lockfile's checksum on CircleCI. - Inputs: package.json files, lockfiles, pnpm-workspace.yaml, .npmrc, Yarn config and patches, and the version file. Tests: unit tests for detection, expansion and every mistake; a golden fixture for both providers; mockci scenarios that a skipped job installs nothing and that each contributed input and the parameters rerun it.
…h; always install the pinned Corepack; set pnpm 11's store dir
…cache only one branch saves
ndbroadbent
force-pushed
the
modules/node
branch
from
December 4, 2026 04:29
9fa607a to
5e29f8a
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #54 (the node module). Its base is
modules/node; retarget it tomainonce #54 merges.What it adds
The
playwrightmodule (GitHub Actions only). It's listed afternode:modules: [node, playwright].<exec> playwright --version) and fails if Playwright isn't installed, instead of lettingnpxdownload the latest.<exec>isnpx,pnpm execoryarn, picked by the package manager.~/.cache/ms-playwright, keyed by OS, arch, Playwright's version and the browsers.deb_cache(on by default):~/.cache/playwright-debs, keyed by arch, a checksum of/etc/os-release, the version and the browsers. The fallback is the newest cache for the same OS release.Keep-Downloaded-Packages, then runsplaywright install-deps.always()step removes the apt config, chowns the directory, and prunes every.debwhose package isn't installed at exactly that version.actions/cache/saveruns only onrefs/heads/<save_branch>, only after a non-exact restore, and only when a.debis left. PRs and other branches read main's cache and never write their own.playwright install <browsers>gets--with-depsonly whendeb_cacheis off.package.json, the lockfile (which pins Playwright) andplaywright.config.*, all inpath.ModuleSpec gains
requires: the modules a job must list before this one.[playwright]or[playwright, node]now fails generation with "listnodebefore it in the job'smodules:".mockci gives each job its own empty
HOME(a separate commit), as a hosted runner does.CARGO_HOMEandRUSTUP_HOMEstill point at the host's toolchain.actions/cachecan now cache~/paths, resolved under that HOME. Before this change, mockci rejected any~path, so a module whose caches live in HOME couldn't be simulated.Tests
tests/module_playwright.rs(mockci), with fake pnpm, sudo, dpkg-deb and dpkg-query:playwright.config.ts, the lockfile,package.jsonor the parameters reruns the job..debcache lifecycle:.debis pruned before saving.github.refgate fails the branch test.playwright.config.*from the inputs fails the inputs test.tests/mockci_home.rs: each job has its own HOME, and a~/path round-trips through the cache.deb_cache: falseandsystem_deps: false;pathand a customsave_branch;requiresordering.integration_tests/module_playwright/. The catalogue and schemas are regenerated.Docs
src/modules/playwright/README.mdandSKILL.md.docs/.../modules.md.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.