cypress-io / circleci-orb

Install, cache and run Cypress.io tests on CircleCI with minimal configuration.
https://circleci.com/orbs/registry/orb/cypress-io/cypress
MIT License
161 stars 101 forks source link

Simplify default cache_key #367

Closed paulfalgout closed 1 year ago

paulfalgout commented 2 years ago

I think the current cache_key might be overly unique. 'cache-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}' It seems to me that including {{ .Branch }} is reducing the value of caching npm. If the checksum of package.json is the same and the architecture is the same, you'd want to reuse the cache would you not?

samuelboland commented 2 years ago

I assume there's some reason that this is the default. That being said, I agree with you. My configuration, with irrelevant parts stripped out, is now:

- cypress/install:
  cache-key: cache-{{arch}}-{{ checksum "package.json"}}
- cypress/run:
  cache-key: cache-{{arch}}-{{ checksum "package.json"}}

This cut my cypress/install step from 2m 16s to 1m 51s. (The remaining time is due to issues unrelated to this post.)

jennifer-shehane commented 1 year ago

The current cache-key in 3.0.0 of the orb is now cypress-cache-{{ arch }}-{{ checksum "package.json" }}. Closing as resolved.