Files
setup-node/docs/adrs/0001-support-caching-deps-for-monorepos.md
T
actions-legeres e2568a51b1
Basic validation / Basic validation (push) Failing after 0s
e2e-cache / Test npm (Node 18, macos-13) (push) Waiting to run
e2e-cache / Test npm (Node 18, macos-latest) (push) Waiting to run
e2e-cache / Test npm (Node 18, windows-latest) (push) Waiting to run
e2e-cache / Test npm (Node 20, macos-13) (push) Waiting to run
e2e-cache / Test npm (Node 20, macos-latest) (push) Waiting to run
e2e-cache / Test npm (Node 20, windows-latest) (push) Waiting to run
e2e-cache / Test npm (Node 22, macos-13) (push) Waiting to run
e2e-cache / Test npm (Node 22, macos-latest) (push) Waiting to run
e2e-cache / Test npm (Node 22, windows-latest) (push) Waiting to run
e2e-cache / Test pnpm (Node 18, macos-13) (push) Waiting to run
e2e-cache / Test pnpm (Node 18, macos-latest) (push) Waiting to run
e2e-cache / Test pnpm (Node 18, windows-latest) (push) Waiting to run
Check dist / Check dist/ (push) Failing after 0s
e2e-cache / Test pnpm (Node 20, macos-13) (push) Waiting to run
e2e-cache / Test pnpm (Node 20, macos-latest) (push) Waiting to run
e2e-cache / Test pnpm (Node 20, windows-latest) (push) Waiting to run
e2e-cache / Test pnpm (Node 22, macos-13) (push) Waiting to run
e2e-cache / Test pnpm (Node 22, macos-latest) (push) Waiting to run
e2e-cache / Test pnpm (Node 22, windows-latest) (push) Waiting to run
e2e-cache / Test yarn 1 (Node 18, macos-13) (push) Waiting to run
e2e-cache / Test yarn 1 (Node 18, macos-latest) (push) Waiting to run
e2e-cache / Test yarn 1 (Node 18, windows-latest) (push) Waiting to run
e2e-cache / Test yarn 1 (Node 20, macos-13) (push) Waiting to run
e2e-cache / Test yarn 1 (Node 20, macos-latest) (push) Waiting to run
e2e-cache / Test yarn 1 (Node 20, windows-latest) (push) Waiting to run
CodeQL analysis / CodeQL analysis (push) Failing after 0s
e2e-cache / Test yarn 3 (Node 18, macos-13) (push) Waiting to run
e2e-cache / Test yarn 3 (Node 18, macos-latest) (push) Waiting to run
e2e-cache / Test yarn 3 (Node 18, windows-latest) (push) Waiting to run
e2e-cache / Test yarn 3 (Node 20, macos-13) (push) Waiting to run
e2e-cache / Test yarn 3 (Node 20, macos-latest) (push) Waiting to run
e2e-cache / Test yarn 3 (Node 20, windows-latest) (push) Waiting to run
e2e-cache / Test yarn 3 (Node 22, macos-13) (push) Waiting to run
e2e-cache / Test yarn 3 (Node 22, macos-latest) (push) Waiting to run
e2e-cache / Test yarn 3 (Node 22, windows-latest) (push) Waiting to run
versions / local-cache (18, macos-13) (push) Waiting to run
versions / local-cache (18, macos-latest) (push) Waiting to run
versions / local-cache (18, windows-latest) (push) Waiting to run
versions / local-cache (20, macos-13) (push) Waiting to run
versions / local-cache (20, macos-latest) (push) Waiting to run
versions / local-cache (20, windows-latest) (push) Waiting to run
versions / local-cache (22, macos-13) (push) Waiting to run
versions / local-cache (22, macos-latest) (push) Waiting to run
versions / local-cache (22, windows-latest) (push) Waiting to run
versions / lts-syntax (lts/*, macos-13) (push) Waiting to run
versions / lts-syntax (lts/*, windows-latest) (push) Waiting to run
versions / lts-syntax (lts/-1, macos-13) (push) Waiting to run
versions / lts-syntax (lts/-1, windows-latest) (push) Waiting to run
versions / lts-syntax (lts/dubnium, macos-13) (push) Waiting to run
versions / lts-syntax (lts/dubnium, windows-latest) (push) Waiting to run
versions / lts-syntax (lts/erbium, macos-13) (push) Waiting to run
versions / lts-syntax (lts/erbium, windows-latest) (push) Waiting to run
versions / lts-syntax (lts/fermium, macos-13) (push) Waiting to run
versions / lts-syntax (lts/fermium, windows-latest) (push) Waiting to run
versions / v8-canary-syntax (20-v8-canary, macos-13) (push) Waiting to run
versions / v8-canary-syntax (20-v8-canary, macos-latest) (push) Waiting to run
versions / v8-canary-syntax (20-v8-canary, windows-latest) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary, macos-13) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary, macos-latest) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary, windows-latest) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary20221101e50e45c9f8, macos-13) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary20221101e50e45c9f8, macos-latest) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary20221101e50e45c9f8, windows-latest) (push) Waiting to run
versions / nightly-syntax (18.0.0-nightly, macos-13) (push) Waiting to run
versions / nightly-syntax (18.0.0-nightly, macos-latest) (push) Waiting to run
Licensed / Licensed (push) Failing after 0s
versions / nightly-syntax (18.0.0-nightly, windows-latest) (push) Waiting to run
versions / nightly-syntax (20-nightly, macos-13) (push) Waiting to run
versions / nightly-syntax (20-nightly, macos-latest) (push) Waiting to run
versions / nightly-syntax (20-nightly, windows-latest) (push) Waiting to run
versions / nightly-syntax (21-nightly, macos-13) (push) Waiting to run
versions / nightly-syntax (21-nightly, macos-latest) (push) Waiting to run
versions / nightly-syntax (21-nightly, windows-latest) (push) Waiting to run
versions / rc-syntax (18.0.0-rc.2, macos-13) (push) Waiting to run
versions / rc-syntax (18.0.0-rc.2, macos-latest) (push) Waiting to run
versions / rc-syntax (18.0.0-rc.2, windows-latest) (push) Waiting to run
versions / rc-syntax (19.0.0-rc.0, macos-13) (push) Waiting to run
versions / rc-syntax (19.0.0-rc.0, macos-latest) (push) Waiting to run
versions / rc-syntax (19.0.0-rc.0, windows-latest) (push) Waiting to run
versions / rc-syntax (20.0.0-rc.1, macos-13) (push) Waiting to run
versions / rc-syntax (20.0.0-rc.1, macos-latest) (push) Waiting to run
versions / rc-syntax (20.0.0-rc.1, windows-latest) (push) Waiting to run
versions / manifest (18.20.0, macos-13) (push) Waiting to run
versions / manifest (18.20.0, macos-latest) (push) Waiting to run
versions / manifest (18.20.0, windows-latest) (push) Waiting to run
versions / manifest (20.10.0, macos-13) (push) Waiting to run
versions / manifest (20.10.0, macos-latest) (push) Waiting to run
e2e-cache / Test npm (Node 20, ubuntu-latest) (push) Failing after 3s
versions / manifest (20.10.0, windows-latest) (push) Waiting to run
versions / manifest (22.0.0, macos-13) (push) Waiting to run
versions / manifest (22.0.0, macos-latest) (push) Waiting to run
versions / manifest (22.0.0, windows-latest) (push) Waiting to run
versions / check-latest (18, macos-13) (push) Waiting to run
versions / check-latest (18, macos-latest) (push) Waiting to run
versions / check-latest (18, windows-latest) (push) Waiting to run
versions / check-latest (20, macos-13) (push) Waiting to run
versions / check-latest (20, macos-latest) (push) Waiting to run
versions / check-latest (20, windows-latest) (push) Waiting to run
versions / check-latest (22, macos-13) (push) Waiting to run
versions / check-latest (22, macos-latest) (push) Waiting to run
versions / check-latest (22, windows-latest) (push) Waiting to run
versions / version-file (.nvmrc, macos-13) (push) Waiting to run
versions / version-file (.nvmrc, macos-latest) (push) Waiting to run
versions / version-file (.nvmrc, windows-latest) (push) Waiting to run
versions / version-file (.tool-versions, macos-13) (push) Waiting to run
versions / version-file (.tool-versions, macos-latest) (push) Waiting to run
e2e-cache / Test npm (Node 18, ubuntu-latest) (push) Failing after 4s
versions / version-file (.tool-versions, windows-latest) (push) Waiting to run
versions / version-file (.tool-versions-node, macos-13) (push) Waiting to run
versions / version-file (.tool-versions-node, macos-latest) (push) Waiting to run
versions / version-file (.tool-versions-node, windows-latest) (push) Waiting to run
versions / version-file (package.json, macos-13) (push) Waiting to run
versions / version-file (package.json, macos-latest) (push) Waiting to run
versions / version-file (package.json, windows-latest) (push) Waiting to run
versions / version-file-volta (macos-13) (push) Waiting to run
versions / version-file-volta (macos-latest) (push) Waiting to run
versions / version-file-volta (windows-latest) (push) Waiting to run
versions / version-file-volta-extends (macos-13) (push) Waiting to run
versions / version-file-volta-extends (macos-latest) (push) Waiting to run
versions / version-file-volta-extends (windows-latest) (push) Waiting to run
versions / node-dist (17, macos-13) (push) Waiting to run
versions / node-dist (17, macos-latest) (push) Waiting to run
versions / node-dist (17, windows-latest) (push) Waiting to run
versions / node-dist (19, macos-13) (push) Waiting to run
versions / node-dist (19, macos-latest) (push) Waiting to run
versions / node-dist (19, windows-latest) (push) Waiting to run
versions / old-versions (macos-13) (push) Waiting to run
versions / old-versions (windows-latest) (push) Waiting to run
versions / arch (push) Waiting to run
versions / node-latest-aliases (current, macos-13) (push) Waiting to run
versions / node-latest-aliases (current, macos-latest) (push) Waiting to run
versions / node-latest-aliases (current, windows-latest) (push) Waiting to run
versions / node-latest-aliases (latest, macos-13) (push) Waiting to run
versions / node-latest-aliases (latest, macos-latest) (push) Waiting to run
versions / node-latest-aliases (latest, windows-latest) (push) Waiting to run
versions / node-latest-aliases (node, macos-13) (push) Waiting to run
versions / node-latest-aliases (node, macos-latest) (push) Waiting to run
versions / node-latest-aliases (node, windows-latest) (push) Waiting to run
e2e-cache / Test npm (Node 22, ubuntu-latest) (push) Failing after 5s
e2e-cache / Test pnpm (Node 18, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test pnpm (Node 20, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test pnpm (Node 22, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test yarn 1 (Node 18, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test yarn 1 (Node 20, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test yarn 3 (Node 18, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test yarn 3 (Node 20, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test yarn 3 (Node 22, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test yarn subprojects (18) (push) Failing after 5s
e2e-cache / Test yarn subprojects (20) (push) Failing after 4s
e2e-cache / Test yarn subprojects (22) (push) Failing after 4s
e2e-cache / Test yarn subprojects all locally managed (18) (push) Failing after 4s
e2e-cache / Test yarn subprojects all locally managed (20) (push) Failing after 4s
e2e-cache / Test yarn subprojects all locally managed (22) (push) Failing after 4s
e2e-cache / Test yarn subprojects some locally managed (18) (push) Failing after 4s
e2e-cache / Test yarn subprojects some locally managed (20) (push) Failing after 4s
e2e-cache / Test yarn subprojects some locally managed (22) (push) Failing after 5s
e2e-cache / Test yarn subprojects managed by git (18) (push) Failing after 4s
e2e-cache / Test yarn subprojects managed by git (20) (push) Failing after 4s
e2e-cache / Test yarn subprojects managed by git (22) (push) Failing after 4s
proxy / test-bypass-proxy (push) Failing after 4s
versions / local-cache (18, ubuntu-latest) (push) Failing after 5s
versions / local-cache (20, ubuntu-latest) (push) Failing after 5s
versions / local-cache (22, ubuntu-latest) (push) Failing after 5s
versions / lts-syntax (lts/*, ubuntu-latest) (push) Failing after 4s
versions / lts-syntax (lts/-1, ubuntu-latest) (push) Failing after 5s
versions / lts-syntax (lts/dubnium, ubuntu-latest) (push) Failing after 5s
proxy / test-proxy (push) Failing after 21s
versions / lts-syntax (lts/erbium, ubuntu-latest) (push) Failing after 6s
versions / lts-syntax (lts/fermium, ubuntu-latest) (push) Failing after 5s
versions / v8-canary-syntax (20-v8-canary, ubuntu-latest) (push) Failing after 5s
versions / v8-canary-syntax (20.0.0-v8-canary, ubuntu-latest) (push) Failing after 4s
versions / v8-canary-syntax (20.0.0-v8-canary20221101e50e45c9f8, ubuntu-latest) (push) Failing after 3s
versions / nightly-syntax (20-nightly, ubuntu-latest) (push) Failing after 4s
versions / nightly-syntax (18.0.0-nightly, ubuntu-latest) (push) Failing after 3s
versions / rc-syntax (18.0.0-rc.2, ubuntu-latest) (push) Failing after 4s
versions / nightly-syntax (21-nightly, ubuntu-latest) (push) Failing after 3s
versions / rc-syntax (19.0.0-rc.0, ubuntu-latest) (push) Failing after 4s
versions / rc-syntax (20.0.0-rc.1, ubuntu-latest) (push) Failing after 4s
versions / manifest (18.20.0, ubuntu-latest) (push) Failing after 4s
versions / manifest (20.10.0, ubuntu-latest) (push) Failing after 3s
versions / manifest (22.0.0, ubuntu-latest) (push) Failing after 4s
versions / check-latest (18, ubuntu-latest) (push) Failing after 3s
versions / check-latest (20, ubuntu-latest) (push) Failing after 4s
versions / check-latest (22, ubuntu-latest) (push) Failing after 4s
versions / version-file (.nvmrc, ubuntu-latest) (push) Failing after 4s
versions / version-file (.tool-versions, ubuntu-latest) (push) Failing after 5s
versions / version-file (.tool-versions-node, ubuntu-latest) (push) Failing after 5s
versions / version-file (package.json, ubuntu-latest) (push) Failing after 4s
versions / version-file-volta (ubuntu-latest) (push) Failing after 6s
versions / version-file-volta-extends (ubuntu-latest) (push) Failing after 4s
versions / node-dist (17, ubuntu-latest) (push) Failing after 4s
versions / node-dist (19, ubuntu-latest) (push) Failing after 3s
versions / old-versions (ubuntu-latest) (push) Failing after 4s
versions / node-latest-aliases (current, ubuntu-latest) (push) Failing after 3s
versions / node-latest-aliases (latest, ubuntu-latest) (push) Failing after 5s
versions / node-latest-aliases (node, ubuntu-latest) (push) Failing after 4s
setup-node v4.4.0 — arbre de 49933ea5288caeca8642d1e84afbd3f7d6820020, sans historique (ops/actions-legeres)
2026-01-01 00:00:00 +00:00

2.0 KiB

0. Support caching dependencies for mono repos

Date: 2021-07-13

Status: Proposed

Context

Currently, actions/setup-node supports caching dependencies for Npm and Yarn package managers.
For the first iteration, we have decided to not support cases where package-lock.json / yarn.lock are located outside of repository root.
Current implementation searches the following file patterns in the repository root: package-lock.json, yarn.lock (in order of resolving priorities)

Obviously, it made build-in caching unusable for mono-repos and repos with complex structure.
We would like to revisit this decision and add customization for dependencies lock file location.

Proposal

We have the following options:

  1. Allow to specify directory where package-lock.json or yarn.lock are located
  2. Allow to specify path to the dependencies lock file (including directory path and filename)

The second option looks more generic because it allows to:

  • specify multiple dependencies files using file patterns like **/package-lock.json (one of recommended approaches in actions/cache)
  • specify custom dependencies files like src/npm-shrinkwrap.json
  • change default resolving priority if both yarn.lock and package-lock.json exist in repository

Decision

Add cache-dependency-path input that will accept path (relative to repository root) to dependencies lock file.
If provided path contains wildcards, the action will search all maching files and calculate common hash like ${{ hashFiles('**/package-lock.json') }} YAML construction does.
The hash of provided matched files will be used as a part of cache key.

Yaml examples:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
  with:
    node-version: 14
    cache: npm
    cache-dependency-path: 'sub-project/package-lock.json'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
  with:
    node-version: 14
    cache: yarn
    cache-dependency-path: 'sub-project/**/yarn.lock'