name: Dart CI
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: "0 0 * * 0"
defaults:
  run:
    shell: bash

jobs:
  build:
    name: "Dart CI"
    runs-on: ubuntu-latest
    steps:
      - uses: actions/cache@v2
        with:
          path: "~/.pub-cache/hosted"
          key: "os:ubuntu-latest;pub-cache-hosted;dart:stable"
      - uses: actions/checkout@v2
      - uses: dart-lang/setup-dart@v1
        with:
          sdk: stable
      - name: "Dependencies"
        run: dart pub upgrade --no-precompile
      - name: "Dart Analyzer"
        run: dart analyze --fatal-infos .
      - name: "Dart Formatter"
        run: dart format --output=none --set-exit-if-changed .
      - name: "VM Tests"
        run: dart test --platform vm --coverage . test/all_test.dart
      - name: "Chrome Tests"
        run: dart test --platform chrome test test/all_test.dart
      - name: "Format coverage"
        run: |
          dart pub global activate coverage
          dart pub global run coverage:format_coverage --base-directory=. --report-on=lib/ --packages=.packages --lcov --in=test/all_test.dart.vm.json --out=test/all_test.dart.lcov
          rm test/all_test.dart.vm.json
      - name: "Upload coverage"
        uses: codecov/codecov-action@v2

name: Dart CI
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: "0 0 * * 0"
defaults:
  run:
    shell: bash

jobs:
  build:
    name: "Dart CI"
    runs-on: ubuntu-latest
    steps:
      - uses: actions/cache@v2
        with:
          path: "~/.pub-cache/hosted"
          key: "os:ubuntu-latest;pub-cache-hosted;dart:stable"
      - uses: actions/checkout@v2
      - uses: dart-lang/setup-dart@v1
        with:
          sdk: stable
      - name: "Dependencies"
        run: dart pub upgrade --no-precompile
      - name: "Dart Analyzer"
        run: dart analyze --fatal-infos .
      - name: "Dart Formatter"
        run: dart format --output=none --set-exit-if-changed .
      - name: "VM Tests"
        run: dart test --platform vm --coverage . test/all_test.dart
      - name: "Chrome Tests"
        run: dart test --platform chrome test test/all_test.dart
      - name: "Collect coverage"
        run: |
          dart pub global activate coverage
          dart pub global run coverage:test_with_coverage --test test/all_test.dart
      - name: "Upload coverage"
        uses: codecov/codecov-action@v2

Fix coverage metrics in Dart 2.17
Fix coverage metrics in Dart 2.17
