Giter Club home page Giter Club logo

Comments (2)

felangel avatar felangel commented on June 23, 2024

Hi @orestesgaolin 👋
Thanks for opening an issue!

We'll take a look shortly and see what we can do to improve the dependency installation step. I think it makes sense to cache the installed dependencies and we can probably use the pubspec.lock to invalidate the cache -- thanks for bringing this up!

from very_good_workflows.

renancaraujo avatar renancaraujo commented on June 23, 2024

Hello everybody. I spent some time looking into this.

Seems like the flutter action takes care of caching everything under ./pub-cache, the problem is that the cache key never considers anything except the flutter version/arch/channel as keys. Subsequent changes on .pub_cache won't be saved to the cache.

We can fix that by providing a custom cache key with a hash to all lock files in the repo. But that will take no effect if the repo has all lock files ignored.

One idea I had was that once the first very_good packages get is run for the top package (app), then all the subsequent runs could use --offline flag to not refetch dependencies via network.

That would be risky and would break in most cases. In a scenario where the cache was mistakenly hit, any new dependencies would break the workflow, and since sub-packages tend to be libraries, their lock is almost always ignored. We cannot rely on the main apps lock since dev dependencies on the sub-packages will not be declared as transitive dependencies on the main apps lock.

An alternative is to consider the pubspec.yaml files as cache breakers.

So here is my proposal:

  • Pass cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.yaml') }} to the flutter action.
  • Include an option to override that key for very good workflow users.
  • Propose the addition of an option to pass "restore-keys" to flutter actions which then would be passed to the cache action. Here: subosito/flutter-action#195

from very_good_workflows.

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.