Dart #376
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 | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: dart-lang/setup-dart@v1 | |
- name: Install dependencies | |
run: dart pub get | |
- name: Verify formatting | |
run: dart format --line-length 120 --output none --set-exit-if-changed . | |
- name: Analyze project source | |
run: dart analyze --fatal-infos lib/ | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: subosito/flutter-action@v1 | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Run tests and generate coverage | |
# Cheat and user flutter instead of dart for coverage test, | |
# as it can generate lcov files directly | |
run: flutter test --coverage | |
- name: Upload coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: coverage/lcov.info | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
sdk: [stable, beta, dev] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: ${{ matrix.sdk }} | |
- name: Install dependencies | |
run: dart pub get | |
- name: Run tests | |
run: dart test |