diff --git a/.github/workflows/format-and-fix.yml b/.github/workflows/format-and-fix.yml index 5c9566298c..e4629b2822 100644 --- a/.github/workflows/format-and-fix.yml +++ b/.github/workflows/format-and-fix.yml @@ -1,23 +1,6 @@ on: workflow_dispatch: - inputs: - package: - required: true - type: choice - options: - - dart - - flutter - - dio - - sqflite - - logging - - file - sdk: - required: false - type: choice - default: dart - options: - - dart - - flutter + push: jobs: cancel-previous-workflow: @@ -33,17 +16,23 @@ jobs: if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} runs-on: ubuntu-latest timeout-minutes: 20 + strategy: + matrix: + package: [ dart, flutter, dio, sqflite, logging, file ] defaults: run: - working-directory: ${{ inputs.package }} + working-directory: ${{ matrix.package }} steps: - uses: actions/checkout@v3 - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 - if: ${{ inputs.sdk == 'dart' }} + if: ${{ package.package != 'flutter' }} - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 - if: ${{ inputs.sdk == 'flutter' }} + if: ${{ package.package == 'flutter' }} - - run: ${{ inputs.sdk }} pub get + - run: dart pub get + if: ${{ package.package != 'flutter' }} + - run: flutter pub get + if: ${{ package.package == 'flutter' }} - run: dart format . @@ -53,4 +42,4 @@ jobs: # we need to pass the current branch, otherwise we can't commit the changes. # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs. - run: ../scripts/commit-formatted-code.sh $GITHUB_HEAD_REF - if: env.GITHUB_HEAD_REF != null +# if: env.GITHUB_HEAD_REF != null