Merge pull request #3 from mfazrinizar/dev #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| branches: [main, dev] | |
| # The root package has no cross-repo deps — only pointycastle (hosted). | |
| # example/ depends on flutter_secure_dotenv_generator ^2.0.0 which is | |
| # not yet on pub.dev, so its resolution warns during dart pub get. | |
| # We use "|| true" because the root package always resolves; only the | |
| # example causes exit 1. Once the generator is published, remove "|| true". | |
| jobs: | |
| analyze: | |
| name: Analyze | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: stable | |
| - run: dart pub get || true | |
| - run: dart format --set-exit-if-changed . | |
| - run: dart analyze --fatal-infos lib/ test/ | |
| test: | |
| name: Test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| sdk: [stable, "3.8.0"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: ${{ matrix.sdk }} | |
| - run: dart pub get || true | |
| - run: dart test | |
| dry-run: | |
| name: Publish Dry Run | |
| runs-on: ubuntu-latest | |
| needs: [analyze, test] | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: stable | |
| - run: dart pub get || true | |
| - run: dart pub publish --dry-run | |
| pana: | |
| name: Package Analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: stable | |
| - run: dart pub global activate pana | |
| - run: dart pub get || true | |
| - run: dart pub global run pana --no-warning . |