This repository was archived by the owner on Oct 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +48
-0
lines changed
Expand file tree Collapse file tree 4 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM ubuntu:latest
2+
3+ RUN apt-get update
4+ RUN apt-get install -y lcov
5+
6+ COPY entrypoint.sh /entrypoint.sh
7+
8+ ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change 1+ # lcov cop
2+
3+ A Github Action which helps enforce a minimum code coverage threshold.
4+
5+ ## Inputs
6+
7+ ### ` path `
8+
9+ ** Required** The path to the ` lcov.info ` file.
10+
11+ ## Example usage
12+
13+ ``` yaml
14+ uses : ChicagoFlutter/lcov-cop@master
15+ with :
16+ path : ' ./coverage/lcov.info'
17+ ` ` `
Original file line number Diff line number Diff line change 1+ name : lcov-cop
2+ author : felangel
3+ description : ' Enforce LCOV Coverage Thresholds'
4+ branding :
5+ icon : ' code'
6+ color : green
7+ inputs :
8+ path :
9+ description : ' lcov path'
10+ required : true
11+ runs :
12+ using : ' docker'
13+ image : ' Dockerfile'
14+ args :
15+ - ${{ inputs.path }}
Original file line number Diff line number Diff line change 1+ #! /bin/sh -l
2+
3+ LCOV_PATH=$1
4+
5+ code_coverage=$( lcov --list ${LCOV_PATH} | sed -n " s/.*Total:|\(.*\)%.*/\1/p" )
6+
7+ echo " Code Coverage: ${code_coverage} %"
8+ if (( $(echo "$code_coverage < 100 " | bc) )) ; then exit 1; fi
You can’t perform that action at this time.
0 commit comments