馃憢 When setting up caching via actions/cache, it's common and recommended to cache ~/.npm after running npm install/ci.
On macOS, this directory is pre-populated with npm packages that are potentially not related to the user's build and is over 1 GB in size. This limits the ability to cache build dependencies due to size constraints and slows down caching due to the larger cache size.
See https://github.com/actions/cache/issues/187
This applies to other ecosystems like Gradle as well
@joshmgross, thank you for your report!
We put pre-cache of some popular NPM packages to macOS images. Unfortunately, it breaks you and it looks like pre-cache approach is inconsistent with actions/cache. We are having some internal discussion about it.
Unfortunately, it can't be fixed quickly but we will keep this issue updated about any news
@maxim-lobanov I had the same problem with the NuGet cache. (https://github.com/actions/cache/issues/115)
Yep, unfortunately, this issue affects NPM, Nuget, Yarn, Gradle, Cocoapods, Carthage on macOS images.
As a temporary work around, you can clean up this cache directory before using actions/cache.
Issue with all tools will be resolved at the same time but no estimation for now.
Small update: We have started to work on this issue. It will require some internal rework so no ETA for now. Hope, it will be fixed soon.
Will keep you updated.
Hello everyone, just a small update.
We have fixed this issue and the new macOS image without pre-cached packages will be delivered in 1 week
馃憢 Hey @maxim-lobanov, do you have any updates on this?
https://github.com/actions/cache/issues/280 reported this with Gradle on macOS
@joshmgross , new macOS image with fix should be deployed this week
Hello everyone,
New image with fix is deployed everywhere and issue should be fixed.
Could you please check and report back if it works for you?
Closing the issue. Feel free to reopen if you still see the issue
馃憢 Hey @maxim-lobanov,
I'm still seeing a large NPM cache on macOS-latest:
Running du -sh ~/.npm outputs: 202M /Users/runner/.npm so the cache is still large compared to the non-existent cache on ubuntu-latest.
Thank you for report.
We have removed pre-cache packages but these 202MB comes from npm install that is done during image provisioning. I will reopen the issue and will fix it too.
Other tools (like gradle and yarn and etc) should be okay
@joshmgross , image with clean npm folder is deployed.
Could you please double check from your side?
Thanks @maxim-lobanov,
Running du -sh ~/.npm on macos-latest shows 4.0K /Users/runner/.npm which is 馃憤
Great, I am closing the issue
Most helpful comment
Hello everyone, just a small update.
We have fixed this issue and the new macOS image without pre-cached packages will be delivered in 1 week