ci: fix tarpaulin JSON field for coverage percentage

This commit is contained in:
Cinco Euzebio 2026-02-28 21:19:56 -03:00
parent f0949e08c5
commit 8a7df892e8

View File

@ -25,7 +25,7 @@ steps:
- apt-get update -qq && apt-get install -y -qq jq curl - apt-get update -qq && apt-get install -y -qq jq curl
- cargo tarpaulin --out Json 2>/dev/null - cargo tarpaulin --out Json 2>/dev/null
- | - |
PCT=$(jq '.coverage | floor' tarpaulin-report.json) PCT=$(jq '(.covered / .coverable * 100) | floor' tarpaulin-report.json)
if [ "$PCT" -ge 80 ]; then COLOR="brightgreen" if [ "$PCT" -ge 80 ]; then COLOR="brightgreen"
elif [ "$PCT" -ge 60 ]; then COLOR="yellow" elif [ "$PCT" -ge 60 ]; then COLOR="yellow"
else COLOR="red"; fi else COLOR="red"; fi