feat: add boolean option package-manager-cache#1641
Merged
jennifer-shehane merged 4 commits intocypress-io:masterfrom Jan 22, 2026
Merged
feat: add boolean option package-manager-cache#1641jennifer-shehane merged 4 commits intocypress-io:masterfrom
jennifer-shehane merged 4 commits intocypress-io:masterfrom
Conversation
|
jennifer-shehane
approved these changes
Jan 22, 2026
Member
jennifer-shehane
left a comment
There was a problem hiding this comment.
Thanks! This all makes sense.
4 tasks
Collaborator
Author
This change has been queued up for a while, so I'm happy I could finally submit it! Unfortunately a glitch on GitHub has interrupted the release. I collected the logs and put them into #1642. |
This was referenced Jan 27, 2026
Closed
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.
Situation
cypress-io/github-actioncaches package manager dependencies for:and offers no equivalent built-in functionality for:
This is particularly a disadvantage for workflows using pnpm:
If a pnpm lockfile
pnpm-lock.yamlis detected, the action caches the npm cache, not the pnpm cache, leading to a potentially incorrect Cypress version usage innpx verifysteps. For projects with pnpm workspaces, this means that the action cannot be used to install dependencies (see description of failure condition in #1594 (comment)). Instead dependencies must be installed usingpnpm installcommands directly.Yarn Modern workflows on the other hand have already been set up to use actions/setup-node to cache the package manager cache of Yarn.
Change
New Option
A new boolean action parameter is added:
package-manager-cachewith default
truefor compatibility with previous action versions. If the parameter is set tofalsethen no caching of package manager caches takes place when the optioninstallis undefined or set totrue. The parameter is not required to be specified.(The parameter name is aligned to the naming in actions/setup-node.)
Use in Examples
GitHub Actions offers a full suite of
setup-*actions to cache dependencies of commonly-used package managers. For Cypress, the relevant caching action is actions/setup-node which offers caching for npm, Yarn (v1 and Modern) and pnpm.npm and Yarn v1 Classic examples are updated to demonstrate use with and without
package-manager-cachesettings and actions/setup-nodepnpm and Yarn Modern examples are updated to add
package-manager-cache: falsesettings and to use actions/setup-node with package manager caching consistently.Verification
For each of the changed examples, verify that first run and re-run are succeeding. They should be caching package manager caches according to their workflow settings.