You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Generate matrix from pubspec.yaml action
v1.3
Note
This action is still in development and may not work as expected.
This GitHub Action generates a matrix of Dart and Flutter SDK versions from a pubspec.yaml
file.
The action takes the following inputs:
-
pubspec
: The path to the pubspec.yaml file. Default:pubspec.yaml
. -
channel
: The Flutter channel to use when resolving the Flutter SDK version. Default:any
-
platform
: The platform to use when resolving the Flutter SDK version. Default: The runner operating system -
strict
: Iftrue
, the action will assert constraints on the Dart SDK version bundled with the Flutter SDK to ensure compatibility. Default:false
matrix
: A JSON string representing the matrix of both Dart and Flutter SDK versions.dart
: The Dart SDK specific versions.flutter
: The Flutter SDK specific versions.
name: test
on:
push:
jobs:
pubspec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: pubspec
name: Generate matrix from pubspec.yaml
uses: flutter-actions/pubspec-matrix-action@v1
with:
pubspec: 'pubspec.yaml'
outputs:
matrix: ${{ steps.pubspec.outputs.matrix }}
test:
needs: pubspec
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJson(needs.pubspec.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- uses: flutter-actions/setup-flutter@v2
with:
version: ${{ matrix.flutter }}
channel: stable
- run: flutter pub get
- run: flutter test
Example
Licensed under the MIT License.