Skip to content

Commit 36c690e

Browse files
author
Ubuntu
committed
Fix coverage-cop
Signed-off-by: Ubuntu <[email protected]>
1 parent 6a12b4d commit 36c690e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/pr_checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ jobs:
322322
fi
323323
echo -e "::endgroup::"
324324
325-
lcov --rc lcov_branch_coverage=1 --list build/coverage.info
325+
lcov --rc lcov_branch_coverage=1 --summary build/coverage.info
326326
327327
- name: Test coverage cop action ${{matrix.inputs.repository}}
328328
if: matrix.inputs.run-complexity && ( success() || failure() )

coverage-cop/action.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ runs:
4646
# TODO: The way it grabs the line/branch coverage is a little complicated
4747
# I'd like to see if this can be done simpler.
4848
echo -e " ${{ env.bashInfo }} Received LCov Report: ${{ inputs.coverage-file }} ${{ env.bashEnd}}"
49-
lcov --list --rc lcov_branch_coverage=1 ${{ inputs.coverage-file }}
50-
LINE_COVERAGE=$(lcov --list ${{ inputs.coverage-file }} | tail -n 1 | cut -d '|' -f 2 | sed -n "s/\([^%]*\)%.*/\1/p")
51-
BRANCH_COVERAGE=$(lcov --rc lcov_branch_coverage=1 --list ${{ inputs.coverage-file }} | tail -n 1 | cut -d '|' -f 4 | sed -n "s/\([^%]*\)%.*/\1/p")
49+
lcov --summary --rc lcov_branch_coverage=1 ${{ inputs.coverage-file }}
50+
LINE_COVERAGE=$(lcov --summary --rc lcov_branch_coverage=1 ${{ inputs.coverage-file }} | grep -E line.*: | cut -d ':' -f 2 | cut -d '%' -f 1 | xargs)
51+
BRANCH_COVERAGE=$(lcov --summary --rc lcov_branch_coverage=1 ${{ inputs.coverage-file }} | grep -E branches.*: | cut -d ':' -f 2 | cut -d '%' -f 1 | xargs)
5252
RESULT=0
5353
5454
# Check Line Coverage

0 commit comments

Comments
 (0)