grpc-dart/.github/workflows/dart.yml

86 lines
2.6 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]
schedule:
- cron: "0 0 * * 0"
jobs:
# Check code formating and static analysis on a single OS (linux)
# against Dart dev.
analyze:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [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 (introp and examples)
run: |
for example in interop example/*/; do
pushd $example
echo [Getting dependencies in $example]
dart pub get
popd
done
shell: bash
- name: Analyze code
run: dart analyze --fatal-infos .
# Run tests on a matrix consisting of three dimensions:
# 1. OS: mac, windows, linux
# 2. release channel: 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: [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 envoy
if: ${{ matrix.platform == 'chrome' }}
run: |
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -sL 'https://getenvoy.io/gpg' | sudo apt-key add -
apt-key fingerprint 6FF974DB | grep "5270 CEAC 57F6 3EBD 9EA9 005D 0253 D0B2 6FF9 74DB"
sudo add-apt-repository "deb [arch=amd64] https://dl.bintray.com/tetrate/getenvoy-deb $(lsb_release -cs) stable"
sudo apt update
sudo apt install -y getenvoy-envoy
env:
MATRIX_OS: ${{ matrix.os }}
shell: bash
- name: Install dependencies
run: dart pub get
- name: Run tests
run: dart test --platform ${{ matrix.platform }}