Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package manager caching strategy for pnpm and Yarn Modern #1366

Open
1 of 4 tasks
MikeMcC399 opened this issue Feb 22, 2025 · 1 comment
Open
1 of 4 tasks

Package manager caching strategy for pnpm and Yarn Modern #1366

MikeMcC399 opened this issue Feb 22, 2025 · 1 comment
Assignees

Comments

@MikeMcC399
Copy link
Collaborator

Situation

cypress-io/github-action caches package manager dependencies for:

and offers no equivalent built-in functionality for:

Background

The variety of package managers has expanded since cypress-io/github-action was originally developed when only npm and Yarn v1 Classic were available and in common use.

The action is set up to recognize the following lockfiles and use GitHub's @actions/cache to cache the related path:

Lockfile Linux path
package-lock.json ~/.npm
yarn.lock ~/.cache/yarn

The above set of path settings does not however cover all currently used package managers:

Package manager Command Linux default example
npm npm config get cache ~/.npm
pnpm v10 pnpm store path ~/.local/share/pnpm/store/v10
Yarn v1 yarn cache dir ~/.cache/yarn/v6
Yarn Modern node-modules yarn config get cacheFolder ~/.yarn/berry/cache
Yarn Modern pnp yarn config get cacheFolder ~/.yarn/berry/cache

This causes the action to attempt to cache unused paths:

  • ~/.npm (unused) for pnpm
  • ~/.cache/yarn (non-existent) for Yarn Modern

Assessment

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.

Duplicating the capability from actions/setup-node into cypress-io/github-action for pnpm and Yarn would involve a significant effort and on-going maintenance for the Cypress team.

Recommendations

  • keep actions/setup-node for pnpm examples
  • add actions/setup-node to Yarn Modern examples
  • add an option to cypress-io/github-action to disable package manager caching, leaving the default as caching enabled
  • add any new package manager caching recommendations into the README document

Related

@MikeMcC399
Copy link
Collaborator Author

MikeMcC399 commented Feb 22, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant