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

Node.js caching like actions/setup-node #70

Open
privatenumber opened this issue Dec 11, 2022 · 0 comments
Open

Node.js caching like actions/setup-node #70

privatenumber opened this issue Dec 11, 2022 · 0 comments
Assignees

Comments

@privatenumber
Copy link
Sponsor

Request

When downloading the Node.js version specified in .npmrc#use-node-version, cache the Node.js like actions/setup-node so it can be setup faster next time

Motivation

I would like to migrate from using a .nvmrc file to specify the development Node.js version, to using pnpm's use-node-version.

Currently on GitHub actions, I can configure actions/setup-node to read from .nvmrc, and it will download & cache the Node.js version so it only takes about 3s to setup.

However, when I move to using pnpm with this action, it doesn't seem to cache the downloaded Node.js and it adds about 8s to the pnpm setup:

Before

Running pnpm recursive install...
  Lockfile is up to date, resolution step is skipped
  Progress: resolved 1, reused 0, downloaded 0, added 0
  .                                        | +386 ++++++++++++++++++++++++++++++++
  Packages are hard linked from the content-addressable store to the virtual store.
    Content-addressable store is at: /home/runner/.local/share/pnpm/store/v3
    Virtual store is at:             node_modules/.pnpm
  Progress: resolved 386, reused 0, downloaded 49, added 45
  Progress: resolved 386, reused 0, downloaded 147, added 144
  Progress: resolved 386, reused 0, downloaded [24](https://github.com/privatenumber/resolve-pkg-maps/actions/runs/3667467601/jobs/6199946930#step:4:26)7, added 243
  Progress: resolved 386, reused 0, downloaded 379, added 378
  Progress: resolved 386, reused 0, downloaded 386, added 386, done
  .../[email protected]/node_modules/esbuild postinstall$ node install.js
  .../[email protected]/node_modules/esbuild postinstall: Done
  Done in 6.7s

After

Running pnpm recursive install...
  Fetching Node.js 16.15.1 ...
  Packages are hard linked from the content-addressable store to the virtual store.
    Content-addressable store is at: /home/runner/.local/share/pnpm/store/v3
    Virtual store is at:             node_modules/.pnpm
  Lockfile is up to date, resolution step is skipped
  Progress: resolved 1, reused 0, downloaded 0, added 0
  .                                        | +386 ++++++++++++++++++++++++++++++++
  Progress: resolved 386, reused 0, downloaded 28, added [23](https://github.com/privatenumber/resolve-pkg-maps/actions/runs/3667468515/jobs/6199947937#step:3:25)
  Progress: resolved 386, reused 0, downloaded 86, added 80
  Progress: resolved 386, reused 0, downloaded 159, added 151
  Progress: resolved 386, reused 0, downloaded 229, added 222
  Progress: resolved 386, reused 0, downloaded [27](https://github.com/privatenumber/resolve-pkg-maps/actions/runs/3667468515/jobs/6199947937#step:3:29)9, added 273
  Progress: resolved 386, reused 0, downloaded [34](https://github.com/privatenumber/resolve-pkg-maps/actions/runs/3667468515/jobs/6199947937#step:3:36)6, added 344
  Progress: resolved 386, reused 0, downloaded 384, added 384
  Progress: resolved 386, reused 0, downloaded 386, added 386, done
  .../[email protected]/node_modules/esbuild postinstall$ node install.js
  .../[email protected]/node_modules/esbuild postinstall: Done
  Done in 14.5s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants