| # CI for the native_* packages. |
| # |
| # Combined into a single workflow so that deps are configured and installed once. |
| |
| name: native |
| permissions: read-all |
| |
| on: |
| pull_request: |
| # No `branches:` to enable stacked PRs on GitHub. |
| paths: |
| - ".github/workflows/native.yaml" |
| - "pkgs/code_assets/**" |
| - "pkgs/data_assets/**" |
| - "pkgs/hooks_runner/**" |
| - "pkgs/hooks/**" |
| - "pkgs/json_syntax_generator/**" |
| - "pkgs/native_test_helpers/**" |
| - "pkgs/native_toolchain_c/**" |
| - "pkgs/repo_lint_rules/**" |
| - "tool/**" |
| push: |
| branches: [main] |
| paths: |
| - ".github/workflows/native.yaml" |
| - "pkgs/code_assets/**" |
| - "pkgs/data_assets/**" |
| - "pkgs/hooks_runner/**" |
| - "pkgs/hooks/**" |
| - "pkgs/json_syntax_generator/**" |
| - "pkgs/native_test_helpers/**" |
| - "pkgs/native_toolchain_c/**" |
| - "pkgs/repo_lint_rules/**" |
| - "tool/**" |
| schedule: |
| - cron: "0 0 * * 0" # weekly |
| |
| jobs: |
| build: |
| strategy: |
| fail-fast: false |
| matrix: |
| os: [ubuntu, macos, windows] |
| sdk: [dev, stable] |
| |
| runs-on: ${{ matrix.os }}-latest |
| |
| defaults: |
| run: |
| working-directory: . |
| |
| steps: |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 |
| |
| - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c |
| with: |
| sdk: ${{ matrix.sdk }} |
| |
| - uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410 |
| with: |
| ndk-version: r27 |
| if: ${{ matrix.os != 'macos' }} |
| |
| - name: Install native toolchains |
| run: sudo apt-get update && sudo apt-get install clang-15 gcc-i686-linux-gnu gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf gcc-riscv64-linux-gnu |
| if: ${{ matrix.os == 'ubuntu' }} |
| |
| - run: dart pub get |
| |
| - name: Run pub get, analysis, formatting, generators, and tests. |
| # Don't run examples on stable, the experiment is not available on stable. |
| run: dart tool/ci.dart --all --no-example |
| if: ${{ matrix.sdk == 'stable' }} |
| |
| - name: Run pub get, analysis, formatting, generators, tests, and examples. |
| run: dart tool/ci.dart --all |
| if: ${{ matrix.sdk != 'stable' }} |
| |
| - name: Upload coverage |
| uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e |
| with: |
| flag-name: native_pkgs_${{ matrix.os }} |
| github-token: ${{ secrets.GITHUB_TOKEN }} |
| parallel: true |
| |
| coverage-finished: |
| needs: [build] |
| runs-on: ubuntu-latest |
| steps: |
| - 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 |