Skip to content

Merge pull request #428 from dreamgene/feat/share-consolidation #349

Merge pull request #428 from dreamgene/feat/share-consolidation

Merge pull request #428 from dreamgene/feat/share-consolidation #349

Workflow file for this run

name: Test Coverage
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
coverage:
name: Test Coverage Report
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin

Check failure on line 34 in .github/workflows/test-coverage.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test-coverage.yml

Invalid workflow file

You have an error in your yaml syntax on line 34
- name: Run tests with coverage
run: |
cargo tarpaulin --all-features --workspace --timeout 300 --exclude-files '*/tests/*' --exclude-files '*/target/*' --exclude-files '*/indexer/*' --exclude-pattern '**/observer.rs' --exclude-pattern '**/event_bus.rs' --out Xml --out Html --output-dir coverage 2>&1 || true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage/coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
- name: Check coverage threshold
run: |
COVERAGE=$(grep -oP 'coverage: \K[0-9.]+' coverage/tarpaulin-report.html | head -1 || echo "0")
THRESHOLD=95.0
echo "Current coverage: ${COVERAGE}%"
echo "Required threshold: ${THRESHOLD}%"
if (( $(echo "$COVERAGE < $THRESHOLD" | bc -l) )); then
echo "ERROR: Coverage ${COVERAGE}% is below threshold ${THRESHOLD}%"
exit 1
fi
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/