Skip to content

Conversation

@vicajilau
Copy link
Collaborator

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:

  • Added a new setup_flutter_versions job 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.
  • Updated the test_flutter_versions job to use the dynamically fetched Flutter versions from the setup_flutter_versions job, replacing the previously hardcoded list.

@vicajilau
Copy link
Collaborator Author

vicajilau commented Dec 19, 2025

Following your suggestion @navaronbracke, the versions are now loaded dynamically 🚀
Look below:
image

- 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"]')
Copy link
Collaborator

@navaronbracke navaronbracke Dec 19, 2025

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?

@vicajilau
Copy link
Collaborator Author

vicajilau commented Dec 19, 2025

There it is @navaronbracke

I've refactored the logic into a Dart script tool/fetch_versions.dart to make it robust and cleaner than the bash approach. I also added a unit test test/fetch_versions_test.dart to verify the filtering logic.

Regarding your points:

  1. Logic: Yes, it grabs the latest patch version for each minor release.
  2. Version Count: I've adjusted it to test 5 stable versions total (the current stable channel + the 4 previous minor versions), plus beta.
    • The script intentionally skips the absolutely latest minor version from the list because that one is already covered by the channel: stable job, avoiding duplicate runs.

So the matrix will look something like: ['3.35.x', '3.32.x', '3.29.x', '3.27.x', 'stable', 'beta'].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants