style: fix code formatting issues #9
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: Test Coverage | |
| on: | |
| push: | |
| branches: [ master, develop ] | |
| pull_request: | |
| branches: [ master, develop ] | |
| jobs: | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: coverage-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Run tests with coverage | |
| run: | | |
| cargo install cargo-tarpaulin | |
| cargo tarpaulin --out Html --out Json --output-dir coverage --timeout 300 --verbose | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| - name: Check coverage threshold | |
| run: | | |
| COVERAGE=$(jq '.coverage // 0' coverage/tarpaulin.json 2>/dev/null || echo "0") | |
| echo "Coverage: $COVERAGE%" | |
| if (( $(echo "$COVERAGE < 80" | bc -l) )); then | |
| echo "❌ Coverage below 80% (current: $COVERAGE%)" | |
| exit 1 | |
| else | |
| echo "✅ Coverage at $COVERAGE%" | |
| fi | |
| - name: Add coverage summary | |
| run: | | |
| COVERAGE=$(jq '.coverage // 0' coverage/tarpaulin.json 2>/dev/null || echo "0") | |
| echo "## Test Coverage" >> $GITHUB_STEP_SUMMARY | |
| echo "Current coverage: **$COVERAGE%**" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Target: 80%+ for M1 v0.1 release" >> $GITHUB_STEP_SUMMARY |