Comments (2)
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.
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)
- fix: flutter format is deprecated in workflows/flutter_package.yml@v1 HOT 2
- fix: semantic_pull_request fails when using breaking syntax
- docs(spell_check): provide default .cspell configuration file in docs
- docs(semantic_pull_request): add information about GitHub permissions HOT 3
- fix(very_good_cli): disallow middleware of middleware HOT 1
- fix(publish): publish times out if invalid pub credentials are provided HOT 3
- fix: coverage_excludes not working for Dart packages HOT 1
- chore: update coverage to latest version
- feat(dart_package): allow run skipped tests HOT 1
- feat(dart_package): allow --no-example on dart pub get HOT 1
- docs: provide documentation for Platform.environment on dart_package
- chore: publish license_check workflow HOT 2
- fix: allow inputs to run workflows in a monorepo HOT 5
- fix: spell_check fails on warning HOT 2
- fix: Cannot exclude generated files from "Check Formatting" HOT 4
- chore(dart_packages): release
- could not load the saved OAuth2 credentials HOT 7
- chore: Create & Release 1.17.0 HOT 2
- docs: license_check docs are incomplete/wrong HOT 3
- Consider the new Automated Publishing documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from very_good_workflows.