From 1db5965441314f6987e71522abffb6a79aa2a0e7 Mon Sep 17 00:00:00 2001 From: Archit Aggarwal Date: Wed, 17 Feb 2021 10:31:21 -0800 Subject: [PATCH] Improve readability of coverage-cop action (#12) --- coverage-cop/action.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/coverage-cop/action.yml b/coverage-cop/action.yml index ae215f89..1cdb584a 100644 --- a/coverage-cop/action.yml +++ b/coverage-cop/action.yml @@ -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