| name: swift2objc | |
| on: | |
| # Run on PRs and pushes to the default branch. | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/swift2objc.yaml' | |
| - 'pkgs/native_test_helpers/**' | |
| - 'pkgs/swift2objc/**' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/swift2objc.yaml' | |
| - 'pkgs/native_test_helpers/**' | |
| - 'pkgs/swift2objc/**' | |
| schedule: | |
| - cron: "0 0 * * 0" | |
| env: | |
| PUB_ENVIRONMENT: bot.github | |
| jobs: | |
| # Check code formatting and static analysis. | |
| analyze: | |
| runs-on: macos-latest | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| working-directory: pkgs/swift2objc/ | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| persist-credentials: false | |
| - uses: dart-lang/setup-dart@6afc89df92d6eb3834022f73cd65adc8cdfcb92d | |
| with: | |
| sdk: stable | |
| - id: install | |
| name: Install dependencies | |
| run: dart pub get | |
| - 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' | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| working-directory: pkgs/swift2objc/ | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| persist-credentials: false | |
| - uses: dart-lang/setup-dart@6afc89df92d6eb3834022f73cd65adc8cdfcb92d | |
| with: | |
| sdk: stable | |
| - 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=swift2objc | |
| - name: Trust Coveralls tap | |
| run: brew trust coverallsapp/coveralls | |
| - name: Upload coverage | |
| uses: coverallsapp/github-action@7eaec0f9ffb3343970b8447736fc85442e961b67 | |
| with: | |
| flag-name: swift2objc | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| parallel: true | |
| path-to-lcov: pkgs/swift2objc/coverage/lcov.info | |
| - name: Upload coverage | |
| uses: coverallsapp/github-action@7eaec0f9ffb3343970b8447736fc85442e961b67 | |
| 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 |