-
Notifications
You must be signed in to change notification settings - Fork 40
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
Save package cache as a post build step #92
Comments
Sounds good. https://github.com/actions/cache/blob/0781355a23dac32fd3bac414512f4b903437991a/action.yml#L20 I wonder why it's not practical to list them for you? |
There's a lot of packages to install, plus I also use the same build script outside of CI for manual invocations, so it would be nice to not have to list out the packages twice but have it work in both cases |
My concern with this request is that I use the resulting MSYS2 environment both for building and for testing a package. Hence, the package is installed before running the tests, but I don't want that to remain in the cache. Also, I don't think it's reasonable to keep uninstalling undesired packages. Therefore, I would propose users defining when to do the caching through an specific step. From a technical point of view, we can distribute two Actions or entrypoints: steps:
- uses: msys2/setup-msys2@v2
- run: install your deps here
- run: do something else
- uses: msys2/setup-msys2/cache@v2
- run: install things which are not to be kept
- run: test whatever |
Note that you can define the list of packages in a file and have that file loaded and passed to setup-msys2. |
Note that only downloads end up in the cache, not things you install. So this is still an issue for our MSYS2 CI where we download random makedepends which we don't want to cache for the next run, but not for a somewhat static sets of tasks. We could also add an option to tell the action when to save the cache (in the default case the post-action would then just do nothing) |
That's good to know, I do multiarch builds though (both 32/64 bit), so having the post-build cache is definitely easier. |
This would be very helpful! |
@MehdiChinoune |
This action is pretty neat, but one thing that would be nice is if saving the package cache could be deferred until after the build is done.
This would be ideal because I have a build script that installs many dependencies (and where it's not really practical to list them out directly in the workflows yml), so it would be nice if it cached those packages too. Not entirely sure if this is possible, although I see actions/cache does it as a post build step.
The text was updated successfully, but these errors were encountered: