subosito / flutter-action

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

feat: add cache restore keys option #195

Closed renancaraujo closed 1 year ago

renancaraujo commented 1 year ago

Cache restore-keys options allow the cache to be restored even when they are invalidated in some cases.

For a scenario where one uses a custom cache-key that includes lock files, a restore-key would be almost always necessary.

     - name: 🐦 Setup Flutter
        uses: subosito/flutter-action@v2
        with:
          flutter-version: 3.3.3
          channel: stable
          cache: true
          cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
          restore-keys: |
            flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
            flutter-:os:-:channel:-:version:-:arch:-:hash
subosito commented 1 year ago

Just added it here https://github.com/subosito/flutter-action/commit/88cab4064b0a5145b0b53b42565b68248a3d7bcb, will publish a release soon. In the meantime please try with the main branch.