subosito / flutter-action

Flutter environment for use in GitHub Actions. It works on Linux, Windows, and macOS.
MIT License
2.16k stars 193 forks source link

Separate Flutter engine & Dart engine cache and pub caches #241

Closed ilovelinux closed 4 months ago

ilovelinux commented 10 months ago

It could be useful to separate Flutter engine & Dart engine cache and pub and allow to invalidate pub caches as needed.

Actual behavior

1) First run with caching. Cache generated: flutter/* 2) Second run, retrieving caches, adding/replacing/updating dependencies. The cache has not been updated since it already exists and the update has not been enforced. 3) Third run, no edits. Needs to download added/replaced/updated dependencies again since the pub cache hasn't been updated.

Expected behavior

1) First run with caching. Two caches were generated: flutter/!.pub-cache with all except .pub-cache folder, and flutter/.pub-cache Optionally, we could allow users to define a custom key for pub caches as we do with cache-key input. 2) Second run, retrieving caches and adding/replacing/updating dependencies. Enforce pub cache update. If the custom key uses ${{ hashFiles('pubspec.lock') }}, create a new minimal (smaller, without older dependencies) cache. 3) Third run, no edits. The cache is valid and ready to use. No need to download new dependencies again.

bramp commented 4 months ago

This may be fixed by https://github.com/subosito/flutter-action/pull/265

subosito commented 4 months ago

Yes, you're correct @bramp. I just updated the v2 and released v2.13.0 for this. Please try @ilovelinux