Skip to content
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

Make it possible to use @buildjet/cache library as a replacement for @actions/cache #25

Open
steve-todorov opened this issue Jan 25, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@steve-todorov
Copy link

steve-todorov commented Jan 25, 2024

Feature request

We are using the Gradle Build Action for our projects and it works great.
However, we are also interested in switching to BuildJet for better build agents.
They also provide faster cache services than GH Cache (link).

Hence the feature request -- allow different cache providers to be used with Gradle Build Action instead of always assuming the action will be using Github Action's Cache

Other forks

It looks like some people tried to create a fork of gradle-build-action and make it use BuildJet, but it's outdated.
So there seems to be an interest for this feature.

@bigdaz
Copy link
Member

bigdaz commented Jan 25, 2024

Thanks for the suggestion. We rely heavily on GitHub's immutable cache entries with restore-keys to find matching entries. Since BuildJet provides an action compatible with actions/cache I suspect that these features are available.

Do you know if BuildJet provides an API for cache access, similar to @actions/cache? This would be a requirement if it were to serve as a replacement for the GHA cache in gradle-build-action.

@steve-todorov
Copy link
Author

Hey @bigdaz,

Thanks for your fast reply!

BuildJet has actually directly forked the @actions/cache repository so I suspect it should be compatible.
Here are their forks:

I am not that familiar with their code base so I cannot give you the best answer just yet.
I've asked one of the BuildJet members to join in this discussion and I hope they might provide more details.

@adamshiervani
Copy link

Hey,
Like @steve-todorov said, all our forks, setup-*, cache and toolkit, can be used as drop-in-replacements of their official equivalent. So, where you use @action/cache you can use @buildjet/cache.

For reference, a popular rust cache action has implemented support for the BuildJet cache. Here is how they did it: Link

I hope that helps!
Best, Adam

@bigdaz
Copy link
Member

bigdaz commented Jan 26, 2024

OK so it seems like it would be possible for gradle-build-action to also leverage Build Jet. A simple option would be a fork of the action replacing @actions/cache with @buildjet/cache. Making this replaceable in code would be less trivial, but I'm sure doable by a Typescript expert (which I'm not).

I'd be happy to consider a contribution for this feature, but I don't see it being a priority.

@bigdaz bigdaz changed the title Allow different cache providers Make it possible to use @buildjet/cache library as a replacement for @actions/cache Feb 9, 2024
@bigdaz bigdaz transferred this issue from gradle/gradle-build-action Feb 9, 2024
@bigdaz bigdaz added the enhancement New feature or request label Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants