Skip to content

Commit

Permalink
revert to working version of coverage ci
Browse files Browse the repository at this point in the history
  • Loading branch information
oiwn committed Nov 15, 2024
1 parent 2f4a949 commit e1f7842
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

env:
CARGO_TERM_COLOR: always
MIN_COVERAGE: 80

jobs:
test:
Expand All @@ -28,39 +27,12 @@ jobs:

- name: Generate coverage report
run: |
# Clean any previous reports
rm -f coverage/*.{html,xml}
mkdir -p coverage
# Run tarpaulin
cargo tarpaulin --verbose \
--workspace \
--timeout 120 \
--out xml \
--out html \
--output-dir coverage
- name: Check coverage threshold
run: |
COVERAGE=$(grep -oP 'line-rate="\K[0-9.]+' coverage/coverage.xml)
COVERAGE_PCT=$(echo "$COVERAGE * 100" | bc)
if (( $(echo "$COVERAGE_PCT < $MIN_COVERAGE" | bc -l) )); then
echo "Coverage ${COVERAGE_PCT}% is below minimum ${MIN_COVERAGE}%"
exit 1
fi
echo "Coverage: ${COVERAGE_PCT}%"
cargo tarpaulin --verbose --workspace --timeout 120 --out xml --out html
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage.xml
files: ./cobertura.xml
fail_ci_if_error: true
verbose: true

- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: coverage/
retention-days: 7

0 comments on commit e1f7842

Please sign in to comment.