chore: update test #45
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 Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: "3.38.3" | |
| channel: "stable" | |
| cache: true | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Analyze code | |
| run: flutter analyze | |
| continue-on-error: true # 允许分析警告,但会显示在结果中 | |
| - name: Run tests | |
| run: flutter test --coverage | |
| continue-on-error: false # 测试失败会阻止后续步骤 | |
| - name: Upload coverage reports | |
| uses: codecov/codecov-action@v4 | |
| if: success() | |
| with: | |
| file: coverage/lcov.info | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false |