test: add unit test and code coverage #3
Workflow file for this run
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: 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 |