Yarn restores cache, but does not install from it
See original GitHub issueHey team!
First, awesome job on this feature, it will immensely help our CI speed for our JavaScript projects, kudos!
I’ve been running on the “over the limit” error for a yarn project with workspaces enabled:
Post job cleanup.
/bin/tar -cz -f /home/runner/work/_temp/3c08f6f0-f11f-4d8f-bed5-d491e7d8d443/cache.tgz -C /home/runner/.cache/yarn .
##[warning]Cache size of 231440535 bytes is over the 200MB limit, not saving cache.
But when I run the same tar
command locally, I get a 100.3 MB bundle. Is there anything I’m missing here?
Here’s my workflow:
name: Test
on:
push:
branches:
- '**'
tags:
- '!**'
jobs:
test:
name: Test, lint, typecheck and build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Use Node.js 10.16.0
uses: actions/setup-node@v1
with:
node-version: 10.16.0
- name: Cache yarn node_modules
uses: actions/cache@v1
with:
path: ~/.cache/yarn
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install
run: yarn install --frozen-lockfile
# ...
Thanks a lot!
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
"yarn global add" doesn't globally install packages ...
yarn -cache. Run a build and then run it again (make sure in the "Restore cache" step that home/ubuntu/.yarn-cache is ...
Read more >setup-node restoring cache but still takes a while to yarn
The built-in cache of setup-node puts the installed packages in the global cache for the package manager used (yarn or npm).
Read more >Yarn cached install slow - Caching Dependencies
The solution to this first issue was due to installing yarn after restoring the cache. We were installing a version of yarn that...
Read more >Janic
Finally managed to properly cache yarn workspaces in github actions. Got install time down from 4mins to < 1 min when cached (basically...
Read more >Why isn't my build using the cached node modules?
If you are here to create a ticket for restoring databases deleted as a result ... it will run yarn install and use...
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
@teohhanhui to be confirmed, we only use
yarn
so I can’t tell. I’d say this is the subject for another issue.In any case,
yarn
caching works to an extent here, so I’ll close this issue. Thanks again for your help @joshmgross 👍You can definitely use a
node_modules
in your cache instead of caching the yarn cache directly, that’s how we handle caching withnpm
(npm
has a cache but it’s not meant to be populated by the user).I’d recommend trying it out and seeing which is faster