feat: setup test-coverage in ci #25
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: (PR) Run flutter test coverage | |
on: | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
env: | |
flutter_version: '3.24.1' | |
flutter_channel: 'stable' | |
jobs: | |
flutter_test_coverage: | |
name: Flutter Test Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2.5.0 | |
with: | |
flutter-version: ${{ env.flutter_version }} | |
channel: ${{ env.flutter_channel }} | |
cache: true | |
- name: Generate required code | |
run: | | |
flutter pub get | |
flutter pub run build_runner build --delete-conflicting-outputs | |
- name: Run flutter test | |
run: | | |
flutter test --coverage | |
- uses: actions/checkout@v2 | |
- name: Very Good Coverage | |
uses: VeryGoodOpenSource/very_good_coverage@v2 | |
run: | | |
flutter test --coverage | |
with: | |
path: "./coverage/lcov.info" | |
min_coverage: 4 | |
exclude: '**/*_observer.dart **/change.dart' |