Skip to content

test: add unit test and code coverage #3

test: add unit test and code coverage

test: add unit test and code coverage #3

Workflow file for this run

name: Flutter Code Coverage
on: [pull_request]
jobs:
test:
name: Run Flutter Tests with Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Install Dependencies
run: flutter pub get
- name: Run Tests with Coverage
run: flutter test --coverage
- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/lcov.info
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
flags: unittests
name: codecov-flutter
fail_ci_if_error: true