From 4389599c5bb28fb6c415c4c4dca7d94427a1df2a Mon Sep 17 00:00:00 2001 From: Rene Floor Date: Thu, 10 Sep 2026 13:09:26 +0200 Subject: [PATCH 1/3] ci(repo): route every Flutter setup through setup-flutter Five call sites configured subosito/flutter-action independently and their cache keys had drifted into two shapes: setup-flutter: flutter-:os:-:channel:-:version:-:arch: everywhere else: flutter-:os:-:channel:-:version:-:arch:-:hash:- So the same SDK gets stored twice. Both of these are live right now: flutter-linux-stable-3.47.3-x64 1640 MiB flutter-linux-stable-3.47.3-x64-e8113bf...-b09b477... 1640 MiB That is 1.6GB of a 10GB repository allowance that currently sits at ~9.05GB, so it evicts other caches. setup-flutter now takes optional flutter-version and channel inputs and owns the key shape; the other call sites pass only what differs. legacy_version_analyze still pins 3.44.0 and so still gets its own entry, which is correct rather than duplication. Two behaviour changes worth noting: - release_publish used a bare flutter-action with no cache and no version pin. It now caches and resolves 3.x like everything else. - beta_version_analyze passes an empty flutter-version so it keeps tracking the newest beta whatever its major version, rather than inheriting the 3.x default. Co-Authored-By: Claude Opus 5 --- .github/actions/pana/action.yml | 7 +------ .github/actions/setup-flutter/action.yml | 13 +++++++++++-- .github/workflows/beta_version_analyze.yml | 6 +++--- .github/workflows/legacy_version_analyze.yml | 4 +--- .github/workflows/release_publish.yml | 2 +- .github/workflows/update_goldens.yml | 12 ++---------- 6 files changed, 19 insertions(+), 25 deletions(-) diff --git a/.github/actions/pana/action.yml b/.github/actions/pana/action.yml index 07b449548b..8cd789dfce 100644 --- a/.github/actions/pana/action.yml +++ b/.github/actions/pana/action.yml @@ -31,12 +31,7 @@ runs: yq eval '.dependencies.stream_chat = {"path": "../stream_chat"}' -i packages/stream_chat_persistence/pubspec.yaml - name: Install Flutter - uses: subosito/flutter-action@v2 - with: - cache: true - channel: stable - flutter-version: "3.x" - cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} + uses: ./.github/actions/setup-flutter - name: Install Pana working-directory: ${{ inputs.working_directory }} diff --git a/.github/actions/setup-flutter/action.yml b/.github/actions/setup-flutter/action.yml index eb4b5434c6..732bcdde0f 100644 --- a/.github/actions/setup-flutter/action.yml +++ b/.github/actions/setup-flutter/action.yml @@ -1,12 +1,21 @@ name: 'Setup Flutter' description: 'Install Flutter with dependency caching' +inputs: + flutter-version: + description: 'Flutter version to install. Empty selects the newest on the channel.' + required: false + default: '3.x' + channel: + description: 'Flutter release channel' + required: false + default: 'stable' runs: using: "composite" steps: - uses: subosito/flutter-action@v2 with: - flutter-version: "3.x" - channel: stable + flutter-version: ${{ inputs.flutter-version }} + channel: ${{ inputs.channel }} cache: true cache-key: "flutter-:os:-:channel:-:version:-:arch:" pub-cache-key: "flutter-pub-:os:-${{ hashFiles('melos.yaml', '**/pubspec.yaml') }}" diff --git a/.github/workflows/beta_version_analyze.yml b/.github/workflows/beta_version_analyze.yml index bfc2d3b200..6a7888e706 100644 --- a/.github/workflows/beta_version_analyze.yml +++ b/.github/workflows/beta_version_analyze.yml @@ -21,11 +21,11 @@ jobs: fetch-depth: 0 - name: "Install Flutter" - uses: subosito/flutter-action@v2 + uses: ./.github/actions/setup-flutter with: channel: beta - cache: true - cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} + # Empty so the newest beta is used, whatever major it is. + flutter-version: '' - name: 📊 Analyze and test packages uses: ./.github/actions/package_analysis diff --git a/.github/workflows/legacy_version_analyze.yml b/.github/workflows/legacy_version_analyze.yml index c5cc4c4aef..b23151d911 100644 --- a/.github/workflows/legacy_version_analyze.yml +++ b/.github/workflows/legacy_version_analyze.yml @@ -65,11 +65,9 @@ jobs: fetch-depth: 0 - name: "Install Flutter" - uses: subosito/flutter-action@v2 + uses: ./.github/actions/setup-flutter with: flutter-version: ${{ env.flutter_version }} - channel: stable - cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} - name: 📊 Analyze and test packages uses: ./.github/actions/package_analysis diff --git a/.github/workflows/release_publish.yml b/.github/workflows/release_publish.yml index 7756fe6c01..773de6917f 100644 --- a/.github/workflows/release_publish.yml +++ b/.github/workflows/release_publish.yml @@ -29,7 +29,7 @@ jobs: uses: dart-lang/setup-dart@v1 - name: 🐦 Install Flutter - uses: subosito/flutter-action@v2 + uses: ./.github/actions/setup-flutter - name: 📦 Install Tools run: flutter pub global activate melos diff --git a/.github/workflows/update_goldens.yml b/.github/workflows/update_goldens.yml index 148397e2d5..67056b3faf 100644 --- a/.github/workflows/update_goldens.yml +++ b/.github/workflows/update_goldens.yml @@ -27,11 +27,7 @@ jobs: uses: actions/checkout@v7 - name: 🐦 Install Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version: "3.x" - channel: stable - cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} + uses: ./.github/actions/setup-flutter - name: 📦 Install Tools run: flutter pub global activate melos @@ -76,11 +72,7 @@ jobs: uses: actions/checkout@v7 - name: 🐦 Install Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version: "3.x" - channel: stable - cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} + uses: ./.github/actions/setup-flutter - name: 📦 Install Tools run: flutter pub global activate melos From 8619a4c2776a5281bf5ce1bd1e199cc35f8ad980 Mon Sep 17 00:00:00 2001 From: Rene Floor Date: Thu, 10 Sep 2026 14:52:57 +0200 Subject: [PATCH 2/3] ci(repo): stop caching the Flutter SDK for the weekly beta job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit beta_version_analyze runs once a week and GitHub expires cache entries after 7 idle days, so an SDK entry is at the expiry boundary by the next run — and a newly released beta changes the resolved version, and so the key, making it a certain miss. It stored ~1.6GB nearly every run for almost no restores. setup-flutter gains a cache-sdk input for this, and now enables pub caching explicitly so turning the SDK cache off keeps it. The pub key carries no channel or version, so beta shares the entry the stable jobs already populate. Co-Authored-By: Claude Opus 5 --- .github/actions/setup-flutter/action.yml | 7 ++++++- .github/workflows/beta_version_analyze.yml | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-flutter/action.yml b/.github/actions/setup-flutter/action.yml index 732bcdde0f..6d336d95af 100644 --- a/.github/actions/setup-flutter/action.yml +++ b/.github/actions/setup-flutter/action.yml @@ -9,6 +9,10 @@ inputs: description: 'Flutter release channel' required: false default: 'stable' + cache-sdk: + description: 'Cache the Flutter SDK. Turn off for jobs that run too rarely to hit it.' + required: false + default: 'true' runs: using: "composite" steps: @@ -16,6 +20,7 @@ runs: with: flutter-version: ${{ inputs.flutter-version }} channel: ${{ inputs.channel }} - cache: true + cache: ${{ inputs.cache-sdk }} + pub-cache: 'true' cache-key: "flutter-:os:-:channel:-:version:-:arch:" pub-cache-key: "flutter-pub-:os:-${{ hashFiles('melos.yaml', '**/pubspec.yaml') }}" diff --git a/.github/workflows/beta_version_analyze.yml b/.github/workflows/beta_version_analyze.yml index 6a7888e706..b7cfaaf6ac 100644 --- a/.github/workflows/beta_version_analyze.yml +++ b/.github/workflows/beta_version_analyze.yml @@ -26,6 +26,9 @@ jobs: channel: beta # Empty so the newest beta is used, whatever major it is. flutter-version: '' + # Weekly, and a new beta invalidates the key, so an SDK entry would + # almost never be restored before it expires. + cache-sdk: 'false' - name: 📊 Analyze and test packages uses: ./.github/actions/package_analysis From 9b1ac12f266dff53bb0f55df3ba6580b2f688183 Mon Sep 17 00:00:00 2001 From: Rene Floor Date: Thu, 10 Sep 2026 15:35:57 +0200 Subject: [PATCH 3/3] docs(ci): say why the beta job's flutter-version must stay empty Names the failure mode rather than the mechanism: inheriting the shared action's 3.x default would keep the weekly beta check on 3.x betas. Co-Authored-By: Claude Opus 5 --- .github/workflows/beta_version_analyze.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/beta_version_analyze.yml b/.github/workflows/beta_version_analyze.yml index b7cfaaf6ac..7ee21bbf37 100644 --- a/.github/workflows/beta_version_analyze.yml +++ b/.github/workflows/beta_version_analyze.yml @@ -24,7 +24,9 @@ jobs: uses: ./.github/actions/setup-flutter with: channel: beta - # Empty so the newest beta is used, whatever major it is. + # Must stay empty. Inheriting the action's 3.x default would hold this + # job on 3.x betas, so it would stop catching the next major early — + # which is the only thing it exists to do. flutter-version: '' # Weekly, and a new beta invalidates the key, so an SDK entry would # almost never be restored before it expires.