CircleCI-Public / node-orb

An orb for working with Node.js on CircleCI
https://circleci.com/orbs/registry/orb/circleci/node
MIT License
52 stars 80 forks source link

Cache dependencies by workflow instead of job #166

Closed goldylucks closed 1 year ago

goldylucks commented 1 year ago

Describe Request:

Would be nice to have this api:

      - node/install-packages:
          pkg-manager: yarn
          cache-path: ~/home/circleci/
          cache-version: "v1.2"
          cache-by: "workflow" # default is "job"

ATM the cache key contains the job name, and I'd like too my jobs to share the cache.

KyleTryon commented 1 year ago

This is currently not possible with the CircleCI's caching abilities and available information within a job. Each "job" on CircleCI is essentially completely unaware that it is part of a workflow, and the orb runs within the context of that running job.