From 05965354300eb5d34d61ffe861be30bc1a93fbd0 Mon Sep 17 00:00:00 2001 From: Socheat Sok Date: Mon, 3 Jun 2024 18:27:30 +0700 Subject: [PATCH] Update README.md --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 12789a1..d5ced00 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ The action takes the following inputs: - `flutter`: The Flutter SDK specific versions. ## Usage + ```yaml name: test @@ -55,12 +56,68 @@ jobs: - uses: flutter-actions/setup-flutter@v2 with: - version: ${{ matrix.flutter }} + version: ${{ matrix.release.flutter }} channel: stable - run: flutter pub get - run: flutter test +``` + +**Or with Dart SDK version only:** + +```yaml +# ... +jobs: + pubspec: + # ... + - id: pubspec + name: Generate matrix from pubspec.yaml + uses: flutter-actions/pubspec-matrix-action@v1 + with: + pubspec: 'pubspec.yaml' + outputs: + dart: ${{ steps.pubspec.outputs.dart }} + + test: + needs: pubspec + # ... + strategy: + dart: ${{fromJson(needs.pubspec.outputs.dart)}} + steps: + # ... + - uses: dart-lang/setup-dart@v1 + with: + sdk: ${{ matrix.dart }} + # ... +``` + +**Or with Flutter SDK version only:** + +```yaml +# ... +jobs: + pubspec: + # ... + - id: pubspec + name: Generate matrix from pubspec.yaml + uses: flutter-actions/pubspec-matrix-action@v1 + with: + pubspec: 'pubspec.yaml' + outputs: + flutter: ${{ steps.pubspec.outputs.flutter }} + test: + needs: pubspec + # ... + strategy: + flutter: ${{fromJson(needs.pubspec.outputs.flutter)}} + steps: + # ... + - uses: flutter-actions/setup-flutter@v2 + with: + version: ${{ matrix.flutter }} + channel: stable + # ... ``` **Example**