-
Notifications
You must be signed in to change notification settings - Fork 840
ci: Dynamically fetch Flutter versions for the CI test matrix instead… #1929
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
base: master
Are you sure you want to change the base?
Conversation
… of using a hardcoded list.
…jor.minor stable releases.
|
Following your suggestion @navaronbracke, the versions are now loaded dynamically 🚀 |
.github/workflows/main.yml
Outdated
| - name: Fetch Flutter versions | ||
| id: id_flutter_versions | ||
| run: | | ||
| VERSIONS=$(curl -s https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json | jq -c '[.releases | map(select(.channel == "stable")) | group_by(.version | split(".")[:2] | join(".")) | map(.[0]) | sort_by(.release_date) | reverse | .[:5] | map(.version)] | flatten + ["stable", "beta"]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bash-fu isn't very strong, so just to double check that this does the following?
Grab the last 4 stable releases, taking the most recent patch version (so for example 3.35.99) and add the current "stable" + "beta" to it?
Can we move this to a script that gets its own unit test?
TIL about https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json
Also, we now test 6! stable releases, which is way mor than Flutter's own policy of "stable" - 2?
…ntegrate into CI workflow.
…y skipping the latest from the top 6, instead of 4.
|
There it is @navaronbracke I've refactored the logic into a Dart script Regarding your points:
So the matrix will look something like: |

This pull request updates the GitHub Actions workflow to dynamically fetch and use the latest stable Flutter versions for testing, instead of hardcoding them. This makes it easier to keep tests up-to-date with new Flutter releases.
Workflow improvements:
setup_flutter_versionsjob that fetches the five latest stable Flutter versions (plus "stable" and "beta" channels) from the Flutter releases API and exposes them as an output for downstream jobs.test_flutter_versionsjob to use the dynamically fetched Flutter versions from thesetup_flutter_versionsjob, replacing the previously hardcoded list.