|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, dev] |
| 6 | + pull_request: |
| 7 | + branches: [main, dev] |
| 8 | + |
| 9 | +# The root package has no cross-repo deps — only pointycastle (hosted). |
| 10 | +# example/ depends on flutter_secure_dotenv_generator ^2.0.0 which is |
| 11 | +# not yet on pub.dev, so its resolution warns during dart pub get. |
| 12 | +# We use "|| true" because the root package always resolves; only the |
| 13 | +# example causes exit 1. Once the generator is published, remove "|| true". |
| 14 | + |
| 15 | +jobs: |
| 16 | + analyze: |
| 17 | + name: Analyze |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + - uses: dart-lang/setup-dart@v1 |
| 22 | + with: |
| 23 | + sdk: stable |
| 24 | + - run: dart pub get || true |
| 25 | + - run: dart format --set-exit-if-changed . |
| 26 | + - run: dart analyze --fatal-infos lib/ test/ |
| 27 | + |
| 28 | + test: |
| 29 | + name: Test |
| 30 | + runs-on: ${{ matrix.os }} |
| 31 | + strategy: |
| 32 | + matrix: |
| 33 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 34 | + sdk: [stable, "3.8.0"] |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + - uses: dart-lang/setup-dart@v1 |
| 38 | + with: |
| 39 | + sdk: ${{ matrix.sdk }} |
| 40 | + - run: dart pub get || true |
| 41 | + - run: dart test |
| 42 | + |
| 43 | + dry-run: |
| 44 | + name: Publish Dry Run |
| 45 | + runs-on: ubuntu-latest |
| 46 | + needs: [analyze, test] |
| 47 | + if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v4 |
| 50 | + - uses: dart-lang/setup-dart@v1 |
| 51 | + with: |
| 52 | + sdk: stable |
| 53 | + - run: dart pub get || true |
| 54 | + - run: dart pub publish --dry-run |
| 55 | + |
| 56 | + pana: |
| 57 | + name: Package Analysis |
| 58 | + runs-on: ubuntu-latest |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v4 |
| 61 | + - uses: dart-lang/setup-dart@v1 |
| 62 | + with: |
| 63 | + sdk: stable |
| 64 | + - run: dart pub global activate pana |
| 65 | + - run: dart pub get || true |
| 66 | + - run: dart pub global run pana --no-warning . |
0 commit comments