Skip to content

Commit

Permalink
Improve readability of coverage-cop action (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
aggarw13 authored Feb 17, 2021
1 parent 7702e5b commit 1db5965
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions coverage-cop/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ inputs:
runs:
using: "composite"
steps:
- run: |
sudo apt-get install lcov
- name: Print coverage data
run: lcov --list --rc lcov_branch_coverage=1 ${{ inputs.path }}
shell: bash
- name: Install lcov (if not present)
run: sudo apt-get install lcov
shell: bash
- name: Check coverage
run: |
LINE_COVERAGE=$(lcov --list ${{ inputs.path }} | tail -n 1 | cut -d '|' -f 2 | sed -n "s/\([^%]*\)%.*/\1/p")
BRANCH_COVERAGE=$(lcov --rc lcov_branch_coverage=1 --list ${{ inputs.path }} | tail -n 1 | cut -d '|' -f 4 | sed -n "s/\([^%]*\)%.*/\1/p")
RESULT=0
Expand Down

0 comments on commit 1db5965

Please sign in to comment.