blob: 33ad42f5e1df4c984c6bcf41cbd3c9f25e2de8d9 [file] [log] [blame] [edit]
# 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_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_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]
runs-on: ${{ matrix.os }}-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- 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, tests, and examples.
run: dart tool/ci.dart --pub --coverage
- name: Upload coverage
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
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@648a8eb78e6d50909eff900e4ec85cab4524a45b
with:
carryforward: "ffigen,jni,jnigen,native_pkgs_macos,native_pkgs_ubuntu,native_pkgs_windows,objective_c,swift2objc"
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true