during my CircleCI build I am saving npm dependencies to cache
steps:
...
- save_cache:
key: deps-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
- "node_modules"
- ".cache/Cypress"
...
next time I build, I restore from cache with
steps:
- checkout
- restore_cache:
key: deps-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
...
but cypress "insists" installing
> [email protected] postinstall /home/circleci/project/node_modules/cypress
> node index.js --exec install
Installing Cypress (version: 3.1.3)
[14:10:00] Downloading Cypress [started]
[14:10:01] Downloading Cypress [completed]
[14:10:01] Unzipping Cypress [started]
[14:10:31] Unzipping Cypress [completed]
[14:10:31] Finishing Installation [started]
[14:10:31] Finishing Installation [completed]
You can now open Cypress by running: node_modules/.bin/cypress open
https://on.cypress.io/installing-cypress
any possibility to avoid this?
because you need to cache folder in your user profile ~/.cache/Cypress and not local folder .cache/Cypress
https://docs.cypress.io/guides/getting-started/installing-cypress.html#Binary-cache
@bahmutov, hmmm, not working with ~/.cache/Cypress either
this is what I use
- save_cache:
key: deps-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
- "node_modules"
- "~/.cache/Cypress"
if you _just_ changed paths list and have not cleared your cache or invalidated it by changing its name to something like key: v2-deps-npm-{{ .Branch }}-{{ checksum "package-lock.json" }} then the _install_ step did not save new list of folders.
Here is our example todomvc circle file commit when we were switching to using orb. You can see the settings that work https://github.com/cypress-io/cypress-example-todomvc/commit/3526270572a8665a4045872364e6b10013d3e456
thanks! right! cache versioning -> (facepalm) -> sorry about this!
Most helpful comment
@bahmutov, hmmm, not working with
~/.cache/Cypresseitherthis is what I use