Closed bartekpacia closed 6 months ago
I like this idea @bartekpacia, I would be happy to merge the PR.
awesome, I'll start on it :)
GitHub Actions doesn't support passing arrays to actions. For example, I would want to have this API:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: '3.19.0'
precache: [android, ios]
but it doesn't work:
Only strings, integers, or booleans can be passed, so that's how actually the API would look like:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: '3.19.0'
precache: '[android, ios]'
I think it's pretty ugly. So right now I'm leaning toward making precache
a boolean.
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: '3.19.0'
precache: true
Someone can contribute the more complex version later, and meanwhile they can continue with calling flutter precache
manually.
What about nested booleans?
precache:
ios: true
android: false
That's some solution, thanks! However it results in quite "tall" code.
I think this would be cool:
Precache artifacts for all currently enabled platforms:
precache: true
OR
precache artifacts for specific platforms:
precache:
ios: true
android: false
Both syntaxes would be correct. I'm not sure if GitHub Actions supports this though (mixed type: value vs list of values).
@yurikoles what do you think?
This feature is mostly for GitHub-hosted runners only. Self-hosted runners retain their state, so precaching seems less important for them. Cheaper Linux runners are preferred due to higher billing multipliers for macOS and Windows runners. Most users require only iOS support on macOS runners. Therefore, I propose to implement one boolean, which will run flutter precache
with no options on Linux, flutter precache --windows
on Windows, and flutter precache --ios
on macOS.
I often have the following code in my workflows
I wish I could so something like:
Possibly it should also allow for more granular selection of artifacts to precache, e.g.
flutter precache --android --ios
would translate to: