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

Include include-branch-in-cache-key in run and test jobs #161

Closed matt-dalton closed 15 hours ago

matt-dalton commented 2 years ago

Describe Request:

I would like to use install-package's include-branch-in-cache-key: false across my jobs, because I don't think it makes sense to re-build my node_modules when starting a new branch if they haven't changed.

I run my test and type checks in separate node/test and node/run jobs. Because these don't have the same include-branch-in-cache-key setting, those jobs will always reinstall their dependencies on the first run on a new branch again.

Examples:

            - build_node # This job includes node/install-packages with include-branch-in-cache-key: false

            # I'd like to add include-branch-in-cache-key: false to these jobs too
            - node/test:
                  name: test
                  cache-version: *yarn_cache_version
                  run-command: test:ci
                  version: *tag
                  pkg-manager: yarn
                  test-results-for: jest
                  requires:
                      - build_node

            - node/run:
                  name: types
                  cache-version: *yarn_cache_version
                  pkg-manager: yarn
                  yarn-run: types
                  version: *tag
                  requires:
                      - build_node

Supporting Documentation Links:

install-package test/run jobs