!t add tests for handling SocketException and FormatException in Mult… #26
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test-and-coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Dart | |
| uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: stable | |
| - name: Install dependencies | |
| run: dart pub get | |
| - name: Ensure coverage tool available | |
| run: dart pub get | |
| - name: Run tests with coverage | |
| run: dart test --coverage=coverage | |
| - name: Generate lcov report | |
| run: | | |
| # Use the local dev_dependency to format coverage into lcov | |
| dart run coverage:format_coverage \ | |
| --lcov \ | |
| --in=coverage \ | |
| --out=coverage/lcov.info \ | |
| --packages=.dart_tool/package_config.json \ | |
| --report-on=lib | |
| - name: Validate coverage file exists | |
| run: | | |
| ls -la coverage || true | |
| if [ ! -f coverage/lcov.info ]; then | |
| echo "ERROR: coverage/lcov.info not found"; exit 1; fi | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| file: coverage/lcov.info | |
| fail_ci_if_error: false |