| name: swiftgen |
| |
| on: |
| # Run on PRs and pushes to the default branch. |
| push: |
| branches: [main] |
| paths: |
| - '.github/workflows/swiftgen.yaml' |
| - 'pkgs/ffigen/**' |
| - 'pkgs/native_test_helpers/**' |
| - 'pkgs/objective_c/**' |
| - 'pkgs/swift2objc/**' |
| - 'pkgs/swiftgen/**' |
| pull_request: |
| branches: [main] |
| paths: |
| - '.github/workflows/swiftgen.yaml' |
| - 'pkgs/ffigen/**' |
| - 'pkgs/native_test_helpers/**' |
| - 'pkgs/objective_c/**' |
| - 'pkgs/swift2objc/**' |
| - 'pkgs/swiftgen/**' |
| schedule: |
| - cron: "0 0 * * 0" |
| |
| env: |
| PUB_ENVIRONMENT: bot.github |
| |
| jobs: |
| # Check code formatting and static analysis. |
| analyze: |
| runs-on: macos-latest |
| defaults: |
| run: |
| working-directory: pkgs/swiftgen/ |
| strategy: |
| fail-fast: false |
| steps: |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 |
| - uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e |
| with: |
| channel: master |
| - id: install |
| name: Install dependencies |
| run: dart pub get && dart pub get --directory="example" |
| - name: Check formatting |
| run: dart format --output=none --set-exit-if-changed . |
| if: always() && steps.install.outcome == 'success' |
| - name: Analyze code |
| run: dart analyze --fatal-infos |
| if: always() && steps.install.outcome == 'success' |
| |
| test-mac: |
| needs: analyze |
| runs-on: 'macos-latest' |
| defaults: |
| run: |
| working-directory: pkgs/swiftgen/ |
| steps: |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 |
| - uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e |
| with: |
| channel: master |
| - name: Install dependencies |
| run: dart pub get |
| - name: Install coverage |
| run: dart pub global activate coverage |
| - name: Run VM tests and collect coverage |
| run: dart pub global run coverage:test_with_coverage --scope-output=swiftgen |
| - name: Upload coverage |
| uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e |
| with: |
| flag-name: swiftgen |
| github-token: ${{ secrets.GITHUB_TOKEN }} |
| parallel: true |
| path-to-lcov: pkgs/swiftgen/coverage/lcov.info |
| - name: Upload coverage |
| uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e |
| with: |
| carryforward: "ffigen,jni,jnigen,native_pkgs_macos,native_pkgs_ubuntu,native_pkgs_windows,objective_c,swift2objc,swiftgen" |
| github-token: ${{ secrets.GITHUB_TOKEN }} |
| parallel-finished: true |