CI: cache the Puppeteer/Chromium download in the mermaid job#9
Merged
Merged
Conversation
The mermaid job installed @mermaid-js/mermaid-cli fresh each run, and its Puppeteer dependency re-downloaded Chromium every time (~hundreds of MB). Cache it: - Pin the mermaid-cli version (MERMAID_CLI_VERSION: "11.16.0") so the browser cache key is stable and knowable before install. npm's floating `@11` resolves to a list of versions, so a runtime-resolved key would be fragile; pinning makes the key deterministic and a version bump the single, explicit way to refresh the cached browser. - Cache ~/.cache/puppeteer (where Puppeteer stores the browser) keyed on runner.os + that version, before the install step. On a cache hit the postinstall finds the browser and skips the download. Rebased onto the uv-managed CI: the cache step slots ahead of the existing `npm install -g` in the mermaid job, leaving the uv-based lint / egress / test jobs untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fd4FtxJFV2fVSSoD7urqqn
grammy-jiang
force-pushed
the
claude/pre-commit-hooks-setup-2sc78y
branch
from
July 20, 2026 00:24
8b1d50b to
8a19470
Compare
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.
What
The
mermaidjob installed@mermaid-js/mermaid-clifresh each run, and its Puppeteer dependency re-downloaded Chromium every time (~hundreds of MB). This caches it:MERMAID_CLI_VERSION: "11.16.0") so the cache key is stable.~/.cache/puppeteer(where Puppeteer stores the browser) keyed onrunner.os+ that version. On a cache hit, the install's postinstall finds the browser and skips the download.MERMAID_CLI_VERSIONto refresh the browser (the key changes → cache miss → re-download + re-save).Notes
🤖 Generated with Claude Code
https://claude.ai/code/session_01Fd4FtxJFV2fVSSoD7urqqn
Generated by Claude Code