diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4ebd5316..82656dc9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -93,8 +93,8 @@ jobs: uses: ./coverage-cop with: path: ./build/coverage.info - branch-min-coverage: 100 - line-min-coverage: 99 + branch-coverage-min: 70 + line-coverage-min: 100 test-memory-statistics: runs-on: ubuntu-latest steps: diff --git a/coverage-cop/action.yml b/coverage-cop/action.yml index 7a37e1a2..ae215f89 100644 --- a/coverage-cop/action.yml +++ b/coverage-cop/action.yml @@ -4,11 +4,11 @@ inputs: path: description: 'Path to lcov output file containing coverage data.' required: true - branch-min-coverage: + branch-coverage-min: description: 'The minumum required branch coverage (in %) for success' required: false default: 100 - line-min-coverage: + line-coverage-min: description: 'The minumum required line coverage (in %) for success' required: false default: 100 @@ -20,15 +20,15 @@ runs: 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 - echo "Required line coverage: ${{ inputs.line-min-coverage }}" + echo "Required line coverage: ${{ inputs.line-coverage-min }}" echo "Line coverage: $LINE_COVERAGE" - if [[ $(echo "$LINE_COVERAGE < ${{ inputs.line-min-coverage }}" | bc) -ne 0 ]]; then + if [[ $(echo "$LINE_COVERAGE < ${{ inputs.line-coverage-min }}" | bc) -ne 0 ]]; then echo "Line Coverage is too low." RESULT=1 fi - echo "Required branch coverage: ${{ inputs.line-min-coverage }}" + echo "Required branch coverage: ${{ inputs.branch-coverage-min }}" echo "Branch coverage: $BRANCH_COVERAGE" - if [[ $(echo "$BRANCH_COVERAGE < $${{ inputs.line-branch-coverage }}" | bc) -ne 0 ]]; then + if [[ $(echo "$BRANCH_COVERAGE < ${{ inputs.branch-coverage-min }}" | bc) -ne 0 ]]; then echo "Branch Coverage is too low." RESULT=1 fi