Dependencies are still installed after cache flag is true
See original GitHub issueDescription: Yarn still installs dependencies even though cache flag is true. Tested on hosted ubuntu-latest env and on self-hosted macOS env.
Action version: Specify the action version actions/checkout@v2
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version:
yarn v1.22.15
Repro steps:
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.
name: unit-tests
on:
workflow_dispatch
jobs:
test:
name: Cache deps
runs-on: ubuntu-latest
steps:
- name: Checkout mobile-react
uses: actions/checkout@v2
- name: Set up Node with cache
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'yarn'
- name: Install yarn dependencies
timeout-minutes: 5
run: yarn install
Expected behavior: After cache is applied yarn install should be skipped.
Actual behavior: After cache is applied yarn installs dependencies .
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
`npm install` installs all dependencies of my project over the ...
To install the packages from the cache force, you can use the following way: $ npm --cache-min 9999999 install.
Read more >Caching in GitLab CI/CD
Use cache for dependencies, like packages you download from the internet. Cache is stored where GitLab Runner is installed and uploaded to S3...
Read more >pnpm install
Only devDependencies are installed and dependencies are removed insofar they were already installed, regardless of the NODE_ENV . --no-optional.
Read more >Super fast npm install on Github Actions - De Voorhoede
A guide to speed up installing Node.js dependencies in a CI environment. ... GitHub cache is still used as the base for a...
Read more >Configuration options | Yarn - Package Manager
If true, Yarn will refuse the change the cache in any way (whether it would ... set it on your CI by manually...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
AHHHH, now I got it. This is why it still takes 40 seconds or so. The modules are all cached (when I specified
cache: 'yarn'
, but they’re in the global cache, yarn still needs to fetch them (but it won’t go online, it’ll find them from the global cache) and resolve them to the local node_modules folder.Thank you so much for spelling this out for me 🙏🏼 🙏🏼 🙏🏼
Hello @akmjenkins. Hosted images have precached versions of Nodejs. If version does not exist on the image, it will be downloaded and precached. If you use self-hosted runners Nodejs versions will be saved. Hosted runners are cleaned at the end of the job, so saved nodejs versions won’t be saved for future runs. If you specify npm or yarn, the action will save global cache for yarn or npm. The cache for yarn and npm is located in different places.
yarn
the action uses these commands:yarn cache dir
(yarn 1) andyarn config get cacheFolder
(other versions)npm
the action uses this command:npm config get cache
pnpm
the action uses this command:pnpm store path