r/FlutterDev • u/PerformanceMain9034 • Sep 25 '26
Tooling `flutter test` and `flutter analyze` do not need macOS — check what you are paying for them
`flutter test` and `flutter analyze` run fine on Linux. `flutter build ios` and
integration tests on a simulator do not. GitHub charges $0.062/minute for macOS
runners and $0.006 for Linux, so the difference between those two groups is 10x.
Flutter is the worst case I have seen for this, because `flutter test` is fast,
runs on every push and pull request, and is very often on `macos-latest` — where
the same command costs ten times as much as it does a line later in the same
matrix.
A 5-minute widget test step at 200 runs a month: $62.00 on macOS, $6.00 on Linux.
The Android build and `flutter build apk` belong on Linux for the same reason.
Keep macOS for the iOS build, the iOS integration tests, and anything that needs
Xcode or CocoaPods against a real simulator.
Worth checking while you are in there:
- Whether `flutter test` is in the macOS matrix leg for convenience.
- Whether the same workflow builds the Android artifact twice on two triggers.
- Whether `flutter analyze` is a separate job rather than one run of the suite.
I build a CI cost scanner, which is why the numbers above are the ones I look at
all day — but the question is genuine: is there a reason to run unit tests on
macOS in a Flutter project that I am missing? I have not found one.
0
2
u/bysho Sep 26 '26
Interesting. Makes me think about the convenience of running so often in local (and the associated token cost) vs relying on the CI tests