diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 534fb8c..624e57d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,17 @@ jobs: forbidden: "unknown" skip_packages: "very_good_analysis" + verify-license-check-flutter: + uses: ./.github/workflows/license_check.yml + with: + working_directory: examples/flutter_package + flutter_channel: stable + flutter_version: "3.41.x" + dependency_type: "direct-dev" + allowed: "" + forbidden: "unknown" + skip_packages: "very_good_analysis" + build: needs: [ @@ -65,6 +76,7 @@ jobs: verify-semantic-pull-request, verify-spell-check, verify-license-check, + verify-license-check-flutter, ] runs-on: ubuntu-latest diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml index 0a52641..ff2e032 100644 --- a/.github/workflows/license_check.yml +++ b/.github/workflows/license_check.yml @@ -15,6 +15,14 @@ on: required: false type: string default: "stable" + flutter_channel: + required: false + type: string + default: "stable" + flutter_version: + required: false + type: string + default: "" allowed: required: false type: string @@ -47,15 +55,28 @@ jobs: runs-on: ${{inputs.runs_on}} + env: + is_flutter: ${{ inputs.flutter_version != '' }} + steps: - name: 📚 Git Checkout uses: actions/checkout@v6 - name: 🎯 Setup Dart + if: env.is_flutter == 'false' uses: dart-lang/setup-dart@v1.7.2 with: sdk: ${{inputs.dart_sdk}} + - name: 🐦 Setup Flutter + if: env.is_flutter == 'true' + uses: subosito/flutter-action@v2 + with: + cache: true + channel: ${{inputs.flutter_channel}} + cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} + flutter-version: ${{inputs.flutter_version}} + - name: 🤫 Set SSH Key env: ssh_key: ${{secrets.ssh_key}} @@ -65,7 +86,7 @@ jobs: ssh-private-key: ${{secrets.ssh_key}} - name: 📦 Install Dependencies - run: dart pub get --no-example + run: ${{ env.is_flutter == 'true' && 'flutter' || 'dart' }} pub get --no-example - name: 👨‍⚖️ Check licenses run: | diff --git a/site/docs/workflows/license_check.md b/site/docs/workflows/license_check.md index 4dfc593..cb6ff6f 100644 --- a/site/docs/workflows/license_check.md +++ b/site/docs/workflows/license_check.md @@ -14,7 +14,7 @@ The License Check functionality is powered by [Very Good CLI's license checker]( The License Check workflow consists of the following steps: -1. Setup Dart +1. Setup Dart or Flutter 2. Set SSH Key (if provided) 3. Install project dependencies 4. Check licenses @@ -35,10 +35,22 @@ The License Check workflow consists of the following steps: ### `dart_sdk` -**Optional** Which Dart SDK version to use. It can be a version (e.g. `3.5.0`) or a channel (e.g. `stable`): +**Optional** Which Dart SDK version to use. It can be a version (e.g. `3.5.0`) or a channel (e.g. `stable`). Ignored when `flutter_version` is set. **Default** `"stable"` +### `flutter_channel` + +**Optional** The Flutter channel to use (e.g. `stable`, `beta`). Only used when `flutter_version` is set. + +**Default** `"stable"` + +### `flutter_version` + +**Optional** Which Flutter SDK version to use. When set, Flutter is used instead of Dart to install dependencies. It can be a version (e.g. `3.24.0`) or a version constraint (e.g. `3.24.x`). + +**Default** `""` + ### `allowed` **Optional** Only allow the use of certain licenses. The expected format is a comma-separated list.