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 84d666d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,24 @@ jobs:
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Install lcov
run: sudo apt-get install lcov

- name: Build project
run: cargo build --verbose

- name: Generate coverage report
run: cargo llvm-cov --lcov --output-path lcov.info

- name: Check coverage threshold
run: |
COVERAGE=$(lcov --summary lcov.info | grep "lines" | cut -d ':' -f 2 | cut -d '%' -f 1 | xargs)
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
with:
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 84d666d

Please sign in to comment.