Closed bahmutov closed 4 years ago
Sample project: https://github.com/MicrosoftDocs/pipelines-javascript but does not show any caching for node_modules
or ~/.npm
folders
More details suggested by other MVPs
Seems Azure CI team is working on general caching solution, might make sense to wait for them
Azure DevOps Pipeline caching came out of preview the other day. It would be great to have an example of how to cache the Cypress binary in YAML Pipelines, as I am currently struggling to make it work.
:tada: This issue has been resolved in version 1.9.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Hi! It might be useful to add that on a windows based image the path is different and looks like this:
- task: CacheBeta@1
inputs:
key: 'cypress | $(Agent.OS) | package-lock.json'
path: 'C:\Users\VssAdministrator\AppData\Local\Cypress'
restoreKeys: 'cypress | $(Agent.OS) | package-lock.json'
displayName: Cache cypress binary
Unfortunately, caching in Azure Pipelines is a bit crippled due to security restrictions described here: https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops#cache-isolation-and-security
Basically, caches are isolated between different branches which makes them less useful when used with short lived feature branches.
I know I am late to the party, but a small improvement on @ekulabuhov post:
Instead of hard coding the path you can also use path: $(LOCALAPPDATA)/Cypress
, also see this
When running on Azure CI public pipelines, I do not see any way to cache NPM dependencies or Cypress binary between the runs. This lead to 3-5 minutes of install time per run.
~/.npm
and~/.cache
folders somehow