go-test-coverage
![Release](https://img.shields.io/github/release/vladopajic/go-test-coverage.svg?style=flat-square)
go-test-coverage
is tool which reports issues when test coverage of a file or package is below set threshold.
Usage
name: Go test coverage check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- name: test (generate coverage)
run: go test ./... -coverprofile=./cover.out
- name: check test coverage
uses: vladopajic/go-test-coverage@v1
with:
config: ./.testcoverage.yml
Config
Example of .testcoverage.yml config file.
profile: cover.out
githubActionOutput: true
localPrefix: "github.com/org/project"
threshold:
file: 80
package: 80
total: 95
Contribution
All contributions are useful, whether it is a simple typo, a more complex change, or just pointing out an issue. We welcome any contribution so feel free to open PR or issue.