Dart CI #135
This file contains 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: Dart CI | |
on: | |
# Run on PRs and pushes to the default branch. | |
push: | |
branches: [master, stable] | |
pull_request: | |
branches: [master, stable] | |
schedule: | |
- cron: "0 0 * * 0" | |
env: | |
PUB_ENVIRONMENT: bot.github | |
jobs: | |
# Check code formatting and static analysis on a single OS (macos). | |
analyze: | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
sdk: [3.0.0] | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f | |
with: | |
sdk: ${{ matrix.sdk }} | |
- id: install | |
name: Install dependencies | |
run: dart pub get && dart pub get --directory="example/shared_bindings" | |
- name: Check formatting | |
run: dart format --output=none --set-exit-if-changed . | |
if: always() && steps.install.outcome == 'success' | |
- name: Build test dylib and bindings | |
run: dart test/setup.dart | |
- name: Analyze code | |
run: dart analyze --fatal-infos | |
if: always() && steps.install.outcome == 'success' | |
test-linux: | |
needs: analyze | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f | |
with: | |
sdk: 3.0.0 | |
- name: Install dependencies | |
run: dart pub get | |
- name: Install libclang-14-dev | |
run: sudo apt-get install libclang-14-dev | |
- name: Build test dylib and bindings | |
run: dart test/setup.dart | |
- name: Run VM tests | |
run: dart test --platform vm --concurrency=1 | |
test-mac: | |
needs: analyze | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f | |
with: | |
sdk: 3.0.0 | |
- name: Install dependencies | |
run: dart pub get | |
- name: Build test dylib and bindings | |
run: dart test/setup.dart | |
- name: Run VM tests | |
run: dart test --platform vm --concurrency=1 | |
- name: Collect coverage | |
run: ./tool/coverage.sh | |
- name: Upload coverage | |
uses: coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: lcov.info | |
test-windows: | |
needs: analyze | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f | |
with: | |
sdk: 3.0.0 | |
- name: Install dependencies | |
run: dart pub get | |
- name: Build test dylib and bindings | |
run: dart test/setup.dart | |
- name: Run VM tests | |
run: dart test --platform vm --concurrency=1 | |
# Sanity check the latest `flutter create --template plugin_ffi`. | |
# This will break if we change the Flutter template or the generated code. | |
# But, getting libclang on the LUCI infrastructure has proven to be | |
# non-trivial. See discussion on | |
# https://github.com/flutter/flutter/issues/105513. | |
# If we need to change the generated code, we should temporarily disable this | |
# test, or temporarily disable the requirement for all bots to be green to | |
# merge PRs. | |
# Running this sanity check on one OS should be sufficient. Chosing Windows | |
# because it is the most likely to break. | |
test-windows-flutter: | |
needs: analyze | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa | |
with: | |
channel: "master" | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build test dylib and bindings | |
run: dart test/setup.dart | |
- name: Run VM tests | |
run: flutter pub run test test_flutter/ --platform vm |