mirror of https://github.com/grpc/grpc-dart.git
80 lines
2.2 KiB
YAML
80 lines
2.2 KiB
YAML
name: Dart
|
|
|
|
on:
|
|
# Run CI on pushes to the master branch, and on PRs against master.
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
# Check code formating and static analysis on a single OS (linux)
|
|
# against Dart stable and dev.
|
|
analyze:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
sdk: [stable, dev]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: cedx/setup-dart@v2
|
|
with:
|
|
release-channel: ${{ matrix.sdk }}
|
|
- name: Report version
|
|
run: dart --version
|
|
- name: Install dependencies
|
|
run: dart pub get
|
|
- name: Check formatting
|
|
run: dart format --output=none --set-exit-if-changed .
|
|
- name: Analyze code (lib and test)
|
|
run: dart analyze .
|
|
- name: Analyze code (introp and examples)
|
|
run: |
|
|
for example in interop example/*/; do
|
|
pushd $example
|
|
echo [Analyzing $example]
|
|
dart pub get
|
|
dart analyze .
|
|
popd
|
|
done
|
|
shell: bash
|
|
|
|
# Run tests on a matrix consisting of three dimensions:
|
|
# 1. OS: mac, windows, linux
|
|
# 2. release channel: stable, dev
|
|
# 3. TODO: Dart execution mode: native, web
|
|
test:
|
|
needs: analyze
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
sdk: [stable, dev]
|
|
platform: [vm, chrome]
|
|
exclude:
|
|
# We only run Chrome tests on Linux. No need to run them
|
|
# on Windows and Mac because they are platform independent.
|
|
- os: windows-latest
|
|
platform: chrome
|
|
- os: macos-latest
|
|
platform: chrome
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: cedx/setup-dart@v2
|
|
with:
|
|
release-channel: ${{ matrix.sdk }}
|
|
- name: Report version
|
|
run: dart --version
|
|
- name: Install grpcwebproxy
|
|
if: ${{ matrix.platform == 'chrome' }}
|
|
run: |
|
|
./tool/install-grpcwebproxy.sh
|
|
echo "/tmp/grpcwebproxy" >> $GITHUB_PATH
|
|
env:
|
|
MATRIX_OS: ${{ matrix.os }}
|
|
shell: bash
|
|
- name: Install dependencies
|
|
run: dart pub get
|
|
- name: Run tests
|
|
run: dart test --platform ${{ matrix.platform }}
|