|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - develop |
| 7 | + pull_request: |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + validate: |
| 19 | + name: Format, analyze, and test |
| 20 | + runs-on: ubuntu-latest |
| 21 | + timeout-minutes: 20 |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Check out repository |
| 25 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 26 | + |
| 27 | + - name: Set up Flutter from .fvmrc |
| 28 | + uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0 |
| 29 | + with: |
| 30 | + channel: stable |
| 31 | + flutter-version-file: .fvmrc |
| 32 | + cache: true |
| 33 | + pub-cache: true |
| 34 | + |
| 35 | + - name: Print toolchain versions |
| 36 | + run: flutter --version |
| 37 | + |
| 38 | + - name: Install package dependencies |
| 39 | + run: flutter pub get |
| 40 | + |
| 41 | + - name: Install example dependencies |
| 42 | + working-directory: example |
| 43 | + run: flutter pub get |
| 44 | + |
| 45 | + - name: Verify formatting |
| 46 | + run: >- |
| 47 | + dart format --output=none --set-exit-if-changed |
| 48 | + lib test example/lib example/test |
| 49 | +
|
| 50 | + - name: Analyze package |
| 51 | + run: flutter analyze --fatal-infos |
| 52 | + |
| 53 | + - name: Run package tests |
| 54 | + run: flutter test |
| 55 | + |
| 56 | + - name: Run example tests |
| 57 | + working-directory: example |
| 58 | + run: flutter test |
| 59 | + |
| 60 | + - name: Build web example |
| 61 | + working-directory: example |
| 62 | + run: >- |
| 63 | + flutter build web --release |
| 64 | + --base-href /flutter_easyloading/ |
| 65 | +
|
| 66 | + - name: Validate publishable package |
| 67 | + run: flutter pub publish --dry-run |
0 commit comments