Skip to content

Commit 9bd99fe

Browse files
update workflow
1 parent ff2a73d commit 9bd99fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/unit-testing.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ jobs:
4040
exit 1
4141
fi
4242
43-
# Extract coverage percentages (handles both whole numbers and decimals)
44-
INSTRUCTION=$(grep -A4 "Total" target/site/jacoco/index.html | grep -E 'class="ctr2"' | sed -n '1p' | sed -E 's/.*>([0-9]+)%<.*/\1/')
45-
BRANCH=$(grep -A4 "Total" target/site/jacoco/index.html | grep -E 'class="ctr2"' | sed -n '2p' | sed -E 's/.*>([0-9]+)%<.*/\1/')
43+
# Extract coverage percentages (filter for ctr2 elements with % symbol only)
44+
INSTRUCTION=$(grep -A10 '<td>Total</td>' target/site/jacoco/index.html | grep -E 'class="ctr2".*%' | sed -n '1p' | sed -E 's/.*>([0-9]+)%<.*/\1/')
45+
BRANCH=$(grep -A10 '<td>Total</td>' target/site/jacoco/index.html | grep -E 'class="ctr2".*%' | sed -n '2p' | sed -E 's/.*>([0-9]+)%<.*/\1/')
4646
4747
echo "📘 Instruction Coverage: ${INSTRUCTION:-0}%"
4848
echo "🌿 Branch Coverage: ${BRANCH:-0}%"

0 commit comments

Comments
 (0)