File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,12 @@ jobs:
4040 exit 1
4141 fi
4242
43- INSTRUCTION=$(grep -A2 "Total" target/site/jacoco/index.html | grep -m1 "%" | sed -E 's/.*>([0-9]+\.[0-9]+)%<.*/\1/')
44- BRANCH=$(grep -A3 "Total" target/site/jacoco/index.html | grep -m2 "%" | tail -n1 | sed -E 's/.*>([0-9]+\.[0-9]+)%<.*/\1/')
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/')
4546
46- echo "📘 Instruction Coverage: ${INSTRUCTION:-0}"
47- echo "🌿 Branch Coverage: ${BRANCH:-0}"
47+ echo "📘 Instruction Coverage: ${INSTRUCTION:-0}% "
48+ echo "🌿 Branch Coverage: ${BRANCH:-0}% "
4849
4950 echo "instruction=${INSTRUCTION:-0}" >> $GITHUB_OUTPUT
5051 echo "branch=${BRANCH:-0}" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments