-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache installed packages for future runs? #23
Comments
Hi @daviwil! Yes, my runs take up to 10 min too... Actually, tool-cache is already used in this action. Hence, using the methods to save and retrieve the cache should be straightforward. The issue is the logic to decide when to save a new cache and when to load it instead of a "clean" install. Currently, there are two main workflows:
Another alternative is to download the packages that are required in For now, I'm thinking about adding option
Allowing specific keys is meant for users to share the same cache for multiple jobs/tasks in the workflow, or to use specific caches for each of them. What do you think? |
pacman caches downloads in |
@lazka, thanks for the hint! Unfortunately, after some testing, it seems that GitHub Actions do NOT support chaching content between workflow/job runs. Caching works in the same job only, or on self-hosted runners. See https://github.com/actions/toolkit/tree/master/packages/tool-cache#cache and this clarification which was not merged: https://github.com/actions/toolkit/pull/358/files @daviwil it seems not possible to do caching in GitHub Actions unless users provide credentials/urls of some external storage service... 😞 |
I see. Can we document how the users can do it themselves maybe? with Not sure if it will help much anyway though |
@lazka, thanks for the reference. I tried it as an Action and also as an npm dependency. It seems that cache keys cannot be updated, so I need to guess the easiest setup which works without requiring users to handle keys themselves. See actions/cache#342. |
So, generating a hash of Currently, the default installation in @lazka, should we try to cache the whole install directory ( EDIT Disabling CheckSpace reduced update time ~40s: https://github.com/eine/setup-msys2/runs/738684884?check_suite_focus=true#step:4:12 |
Uh, so there are both i686/x86_64 toolchains and some more installed by default? I'd just go with not using the image installation then. Our CI takes 45secs to download/install/update right now.
Sounds like a good idea then 👍 |
Oh, I spent months trying to explain @MSP-Greg why it might be NOT a good idea to install by default all the packages that a single user seemed to consider of most importance (see quotes below). However, it had absolutely no effect; and he wrote the PRs (https://github.com/actions/virtual-environments/pulls?q=is%3Apr+sort%3Aupdated-desc+author%3AMSP-Greg+is%3Aclosed) with little supervision. Maybe if you tell in msys2/msys2-installer#5, he/she will listen to you.
I really had the hope GitHub employees would care about the UX of the features they introduce, but quality measurements seem to be relaxed for GitHub Actions yet. Hence, I think I'll do as you say, and I'll undo using the image installation.
I copied the idea from some other script in MSYS2 repos... 😄
|
Yes, not as many packages as AppVeyor; the emphasis was on compile tools. Generally, I only update what I need... |
By NOT using the default installation, update time was reduced from 7-12 min to 1-3 min:
I'm closing this issue, because @daviwil, using |
@eine Thanks so much for investigating this so thoroughly! I'm going to switch over to the new release and use the |
@daviwil, it was an interesting issue, indeed. If you use NOTE: strictly, the change from v1.0.1 to v1.1.0 includes a breaking change. But I have considered the advantages to be worth it, and I don't feel like bumping to v2 because of this. |
I was still sitting on |
Switch to a `setup-msys2` fork working around msys2/MSYS2-packages#1962
Hi @eine! Do you know if there might be any way this action could cache packages that are installed with
install
so that they don't need to be re-installed each time a workflow runs? Mysetup-msys2
runs often take about 7 minutes to update and then install packages so it'd be nice to skip that. Looks like@actions/tool-cache
has the ability to cache directories:https://github.com/actions/toolkit/tree/master/packages/tool-cache#cache
The text was updated successfully, but these errors were encountered: