flutter-setup: exact-key pub cache only (prefix restore-keys broke pub get after a git-dep bump)
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
file length / file-length (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
palette drift / palette (push) Has been cancelled
repo-contract / repo contract (push) Has been cancelled
shared gate tests / gate unit tests (push) Has been cancelled

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Krzysztof Rudnicki 2026-10-10 18:39:29 +02:00
parent 21da7bcc90
commit cd76eb0a95

View File

@ -58,9 +58,13 @@ runs:
echo "$HOME/sdk/flutter-slim/bin" >> "$GITHUB_PATH" echo "$HOME/sdk/flutter-slim/bin" >> "$GITHUB_PATH"
echo "PUB_CACHE=$HOME/.pub-cache" >> "$GITHUB_ENV" echo "PUB_CACHE=$HOME/.pub-cache" >> "$GITHUB_ENV"
# Exact key only, no prefix restore-keys: an older lockfile's pub cache,
# restored after a git-dependency bump, made `flutter pub get` fail with
# "package_graph.json: dependencies for <pkg> missing" (daily-limits,
# 2026-10-10), and a failed job never saves the new key, so every rerun
# failed the same way. A lockfile change now pays one cold `pub get`.
- name: Restore the pub cache - name: Restore the pub cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ~/.pub-cache path: ~/.pub-cache
key: pub-${{ inputs.flutter-version }}-${{ runner.os }}-${{ hashFiles(format('{0}/pubspec.lock', inputs.working-directory)) }} key: pub-${{ inputs.flutter-version }}-${{ runner.os }}-${{ hashFiles(format('{0}/pubspec.lock', inputs.working-directory)) }}
restore-keys: pub-${{ inputs.flutter-version }}-${{ runner.os }}-