Skip to content

Commit

Permalink
Add codecov configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
romanovich23 committed Dec 8, 2024
1 parent bec37d1 commit 58df519
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ jobs:
- name: Build project
run: cargo build --verbose

- name: Generate coverage report
run: cargo llvm-cov --lcov --output-path lcov.info
- name: Generate coverage and check threshold
run: |
COVERAGE=$(cargo llvm-cov report | grep "TOTAL" | awk '{print $4}' | sed 's/%//')
echo "Coverage: $COVERAGE%"
if (( $(echo "$COVERAGE < 80" | bc -l) )); then
echo "Coverage is below 80%"
exit 1
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
Expand Down
9 changes: 9 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage:
status:
project:
default:
target: 80%
threshold: 1%
patch:
default:
target: 80%

0 comments on commit 58df519

Please sign in to comment.