Skip to content

[EngSys] Use actions/cache for "npm ci" to improve perf #32896

Closed

Description

https://github.com/actions/cache/blob/main/examples.md#node---npm

On Linux, only improved perf of "npm ci" in repo root from 12s to 11s (including cache restore time), so not worth it for perf alone.

However, the cache may be more reliable, and prevent failures like this E429:

npm ci
  npm error code E429
  npm error 429 Too Many Requests - GET https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz
  npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2025-08-26T07_10_24_348Z-debug-0.log
  Error: Process completed with exit code 1.

https://github.com/Azure/azure-rest-api-specs/actions/runs/17230687842/job/48884070364?pr=36640#step:8:31

Root cause of 429 was an npmjs incident, so maybe this is expected to be rare?

https://status.npmjs.org/incidents/njwnds2vmdhz

Simplest option might be to use the caching feature builtin to setup-node:

https://github.com/actions/setup-node?tab=readme-ov-file#caching-global-packages-data

Activity

  1. mikeharder commented on Feb 28, 2025

    @mikeharder
    ContributorAuthor

    Only improved perf of "npm ci" in repo root from 12s to 11s (including cache restore time), so currently not worth the added complexity.

  2. moved this from 🔬 Dev in PR to 🎊 Closed in Azure SDK EngSys 🚀🌒🧑‍🚀on Mar 4, 2025
  3. timotheeguerin commented on Sep 22, 2026

    @timotheeguerin
    Member

    Closing as completed for the current dependency-installation tooling.

    #43922 migrated installation to pnpm and provides explicit actions/cache caching of the pnpm store in the shared setup-node-install-deps action. The cache is namespaced by OS, architecture, install profile, and lockfile, with restore keys and an opt-out for small installs. This supplies the requested dependency caching for the package manager now used by the repository.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions