test: add comprehensive unit tests with 60-100% coverage #5
This file contains hidden or 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 CI | |
| on: | |
| push: | |
| branches: ["main"] | |
| paths: | |
| - "lib/**" | |
| - "test/**" | |
| - "pubspec.yaml" | |
| - "pubspec.lock" | |
| - "analysis_options.yaml" | |
| - ".github/workflows/flutter-ci.yml" | |
| pull_request: | |
| branches: ["main"] | |
| paths: | |
| - "lib/**" | |
| - "test/**" | |
| - "pubspec.yaml" | |
| - "pubspec.lock" | |
| - "analysis_options.yaml" | |
| - ".github/workflows/flutter-ci.yml" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: "stable" | |
| # flutter-version: 'latest' # Optional, defaults to latest | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Run code generation | |
| run: dart run build_runner build --delete-conflicting-outputs | |
| - name: Flutter Analyze | |
| run: flutter analyze | |
| - name: Flutter Test | |
| run: flutter test --coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage/lcov.info | |
| fail_ci_if_error: false | |
| verbose: true |