Open bigdaz opened 3 months ago
@bigdaz thanks for opening the issue. Would be nice to extract the custom S3 backend code into a separate lib indeed. I may have a stab at it, but would need to see how you switch cache backend currently in your grade action. Could you send me some pointers?
Thanks!
Thanks. It would be amazing if we could support an S3 cache backend for setup-gradle
. I considered implementing support directly in the action, but I think it makes more sense for runs-on/cache
to provide a general-purpose implementation if that's possible. I'm happy to help with testing (and possibly implementation), but I have zero experience with publishing an NPM library.
The setup-gradle
action doesn't have any ability to switch between different cache backends, since we only currently support the main GitHub Actions cache. However we have a feature request to support @buildjet/cache
which would require something similar.
In the end, all of our cache access boils down to these 2 methods for save and restore. It should be relatively straightforward to make this implementation pluggable for different cache backends.
(Note that for reporting purposes we patch the @actions/cache
API so that we can access the size of the saved/restored cache entry, as well as any underlying errors that occur. So our requirements go a little beyond what's provided by @actions/cache
.)
@crohr Is there a way to help on extracting the separate library for this need, or is it already being worked on?
We received a feature request for the
setup-gradle
action to supportruns-on/cache
: https://github.com/gradle/actions/issues/279The
setup-gradle
action does not useactions/cache
directly, but instead uses the@actions/cache
library to save and restore cache entries.Is there an equivalent API (in a published library) that can be used to save/restore cache entries via
runs-on/cache
?