Giter Club home page Giter Club logo

Comments (6)

bilelmoussaoui avatar bilelmoussaoui commented on June 18, 2024

That's already possible?

from flatpak-github-actions.

rkoesters avatar rkoesters commented on June 18, 2024

Hmm.... I do not see a restore-key or restore-keys option in https://github.com/bilelmoussaoui/flatpak-github-actions/blob/master/flatpak-builder/action.yml. To be clear, I'm not referring to restoring the value of cache-key, I'm talking about have a prefix key that can be restored from if no cache matching cache-key exists.

Here is an example of that when using the actions/cache action: https://github.com/rkoesters/xkcd-gtk/blob/master/.github/workflows/ci.yml#L46-L47. In that case, the action first tries to find a cache matching key (${{ env.GOVERSION }}-${{ hashFiles('**/go.sum') }}), this is equivalent to cache-key in the flatpak-builder action. If that does not exist, it then looks for a cache matching the restore-keys prefixes (${{ env.GOVERSION }}-).

It appears that the cache package that your action uses supports this behavior, all you would need to do is pass that user supplied value: https://github.com/actions/toolkit/blob/main/packages/cache/README.md

Thanks!

from flatpak-github-actions.

bilelmoussaoui avatar bilelmoussaoui commented on June 18, 2024

What's the use case here?

from flatpak-github-actions.

rkoesters avatar rkoesters commented on June 18, 2024

The use-case is to leverage the cache to try and speed up builds. If a cache doesn't exist for the exact cache-key provided, then the workflow can load an existing cache that matches the restore-key prefix. This eliminates the need to freshly download each dependency for each workflow build (for git sources this means the git pull just verifies there is nothing new to download; if there are changes, it just needs to download the deltas).

In theory, it could also be used to avoid recompiling bits of code that have not changed, however that would be build system specific, so I'd say its a bit out of scope for this request.

from flatpak-github-actions.

bilelmoussaoui avatar bilelmoussaoui commented on June 18, 2024

I mean that's what cache-key option provides for you already. The restore keys are hardcoded to the flatpak-builder- & flatpak- along with the cache-key that you define. The reason why we allow you to set one is because the action keeps complaining that an action already defined this cache key which is completely wrong (an issue is already open on the cache action side) and we suggest people to assign it to flatpak-$git-commit-sha to avoid the issue.

I don't see what else we should provide

from flatpak-github-actions.

bilelmoussaoui avatar bilelmoussaoui commented on June 18, 2024

I am going to assume the latest releases should cover everything you might need for improving caching. Please re-open if that is not the case

from flatpak-github-actions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.