Skip to content

Commit d419e68

Browse files
author
WangGLJoseph
committed
enable printing branch coverage on CI
1 parent f84ed47 commit d419e68

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/pytest.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ jobs:
5151
exit 1
5252
fi
5353
54+
- name: Print Branch Coverage
55+
run: |
56+
echo "Branch Coverage Details:"
57+
echo "Total Branches: $(grep -o 'branches-valid="[0-9]*"' coverage.xml | sed 's/branches-valid="//;s/"//')"
58+
echo "Branches Covered: $(grep -o 'branches-covered="[0-9]*"' coverage.xml | sed 's/branches-covered="//;s/"//')"
59+
echo "Branch Rate: $(grep -o 'branch-rate="[0-9\.]*"' coverage.xml | sed 's/branch-rate="//;s/"//')"
60+
5461
- name: SonarQube Scan
5562
uses: SonarSource/sonarqube-scan-action@v4
5663
env:

0 commit comments

Comments
 (0)