Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
socheatsok78 committed Jun 3, 2024
1 parent a4d3d0f commit 0596535
Showing 1 changed file with 58 additions and 1 deletion.
59 changes: 58 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The action takes the following inputs:
- `flutter`: The Flutter SDK specific versions.

## Usage

```yaml
name: test

Expand Down Expand Up @@ -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**
Expand Down

0 comments on commit 0596535

Please sign in to comment.