subosito/flutter-action

Separate Flutter engine & Dart engine cache and pub caches

ilovelinux opened this issue · 2 comments

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.