Skip to content

Commit ef4f4aa

Browse files
committed
ci: Dynamically fetch Flutter versions for the CI test matrix instead of using a hardcoded list.
1 parent 7e545fa commit ef4f4aa

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,24 @@ on:
77
branches: [ master ]
88

99
jobs:
10+
setup_flutter_versions:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
flutter-versions: ${{ steps.id_flutter_versions.outputs.versions }}
14+
steps:
15+
- name: Fetch Flutter versions
16+
id: id_flutter_versions
17+
run: |
18+
VERSIONS=$(curl -s https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json | jq -c '[.releases | map(select(.channel == "stable")) | .[:5] | map(.version)] | flatten + ["stable", "beta"]')
19+
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
20+
1021
test_flutter_versions:
22+
needs: setup_flutter_versions
1123
runs-on: ubuntu-latest
1224
strategy:
1325
fail-fast: false
1426
matrix:
15-
flutter: [ '3.24.0', '3.27.0', '3.29.0', '3.32.0', '3.35.0', 'stable', 'beta' ]
27+
flutter: ${{ fromJson(needs.setup_flutter_versions.outputs.flutter-versions) }}
1628
name: Tests on Flutter ${{ matrix.flutter }}
1729
steps:
1830
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)