Skip to content

Commit e9ef56b

Browse files
committed
ci: speed up flutter clone
1 parent 1c3946b commit e9ef56b

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

.github/shared_workflows/setup_flutter/action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,31 @@ runs:
2020
echo "FLUTTER_HASH=${ENGINE_VERSION}-${FLUTTER_PACKAGES_VERSION}" >> $GITHUB_ENV
2121
2222
- name: Cache Flutter
23+
id: cache-flutter
2324
uses: actions/cache@v4
2425
with:
2526
path: |
2627
submodules/flutter/**/.dart_tool
2728
submodules/flutter/**/bin/cache
28-
submodules/flutter/version
2929
key: ${{ runner.os }}-flutter-${{ env.FLUTTER_HASH }}
3030

3131
- name: Cache Pub
32+
id: cache-pub
3233
uses: actions/cache@v4
3334
with:
3435
path: submodules/flutter/.pub-cache
3536
key: ${{ runner.os }}-pub-${{ env.FLUTTER_HASH }}-${{ hashFiles('**/pubspec.lock') }}
3637
restore-keys: |
3738
${{ runner.os }}-pub-${{ env.FLUTTER_HASH }}-
3839
40+
- name: Restore Flutter version information
41+
shell: bash
42+
run: |
43+
FLUTTER_VERSION=$(cat ${{ github.workspace }}/submodules/.flutter-version)
44+
echo "$FLUTTER_VERSION" > ${{ github.workspace }}/submodules/flutter/version
45+
git -C submodules/flutter tag -f stable
46+
git -C submodules/flutter tag -f "$FLUTTER_VERSION"
47+
3948
- name: Pre-download Flutter dependencies
4049
shell: bash
4150
run: flutter doctor -v

.github/workflows/tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
uses: actions/checkout@v5
1616
with:
1717
submodules: true
18-
fetch-depth: 0
1918

2019
- uses: "./.github/shared_workflows/install_apt_dependencies"
2120

scripts/update_flutter_submodule.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/usr/bin/env bash
22

3+
# Update local Flutter SDK
4+
flutter channel stable
5+
flutter upgrade
6+
37
# Update Flutter version used in F-Droid builds
48
pushd submodules/flutter
59
git fetch origin
@@ -10,4 +14,4 @@ popd
1014

1115
# Update Flutter version used in Linux builds
1216
FLUTTER_VERSION=$(flutter --version | head -n 1 | awk '{print $2}')
13-
sed -i -E "s/flutter-version: .*/flutter-version: $FLUTTER_VERSION/" .github/workflows/linux.yml
17+
echo "$FLUTTER_VERSION" > submodules/.flutter-version

submodules/.flutter-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.35.3

0 commit comments

Comments
 (0)