Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pub cache returns old cache #319

Open
rolandmosimann opened this issue Jul 9, 2024 · 0 comments
Open

Pub cache returns old cache #319

rolandmosimann opened this issue Jul 9, 2024 · 0 comments

Comments

@rolandmosimann
Copy link

When using the default configuration for pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" that action returns unexpected old caches.

The setup of the actions/cache@v4 enables this with:

        key: ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }}
        restore-keys: |
          ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }}
          ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}

the first restore-key has the same value as the actual key and could therefore be removed. The second value find the lastest created, but considering the pubspec.lock files.

The cache with the most recent creation date would be used.

according to: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key

My suggestion is to remove those restore-keys to make the caching behaviour more predictable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant