chore(soroban): doc amount-bounds #184
Workflow file for this run
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: [main, "audit/**", "test/**"] | ||
| pull_request: | ||
| branches: [main] | ||
| jobs: | ||
| coverage: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install Rust | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| - name: Install tarpaulin | ||
| run: cargo install cargo-tarpaulin --locked | ||
| - name: Run tests | ||
| run: cargo test --verbose | ||
| - name: Generate coverage report | ||
| run: cargo tarpaulin --config tarpaulin.toml | ||
| - name: Upload coverage reports | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: coverage-report | ||
| path: coverage/ | ||
| - name: Check coverage threshold (≥ 95 %) | ||
| run: | | ||
| <<<<<<< fix/consolidated-improvements | ||
| COVERAGE=$(cargo tarpaulin --out Stdout | grep -oP '\d+\.\d+(?=% coverage)' | head -1) | ||
| echo "Current coverage: $COVERAGE%" | ||
| # Note: 92%+ is acceptable given Soroban SDK event publishing limitations | ||
| # Functional coverage of business logic is 100% | ||
| if (( $(echo "$COVERAGE >= 95.0" | bc -l) )); then | ||
| echo "✅ Coverage threshold met: $COVERAGE% >= 95%" | ||
| exit 0 | ||
| else | ||
| echo "❌ Coverage below threshold: $COVERAGE% < 95%" | ||
| ======= | ||
| COVERAGE=$(cargo tarpaulin --config tarpaulin.toml 2>&1 \ | ||
| | grep -oP '\d+\.\d+(?=% coverage)' | head -1) | ||
| echo "Current coverage: ${COVERAGE}%" | ||
| if [ -z "$COVERAGE" ]; then | ||
| echo "❌ Could not parse coverage output" | ||
| exit 1 | ||
| fi | ||
| if awk "BEGIN { exit !($COVERAGE >= 95.0) }"; then | ||
| echo "✅ Coverage threshold met: ${COVERAGE}% >= 95%" | ||
| else | ||
| echo "❌ Coverage below threshold: ${COVERAGE}% < 95%" | ||
| >>>>>>> main | ||
| exit 1 | ||
| fi | ||