Don't go undercov! Track your test coverage and check for under-coverage with this Git standalone tool. 🕵️
undercov is a command-line tool built with Go that helps you track your test coverage. It works standalone and stores the coverage data inside a branch in your Git repository. With undercov, you can easily check on your CI pipeline if your changes meet the required coverage thresholds, ensuring that your code is well-tested and maintainable.
- Supports monorepos with multiple coverage files.
undercov is a single multi-platform binary that you can download from the release page.
threshold: The minimum coverage percentage required to pass the check.files: The glob pattern to locate the coverage files (e.g.,**/coverage/lcov.info).branch: The name of the branch where the coverage data will be stored (default:coverage).push: Push the updated coverage branch to a remote (default:false).remote: The remote used whenpushis enabled (default:origin).push-force-with-lease: Push with--force-with-leasewhenpushis enabled (default:false).
By default, undercov stores coverage snapshots in the local coverage branch only. Enable push in CI to publish updates to the remote branch. If your remote branch can diverge (for example with parallel jobs), push-force-with-lease allows replacing the remote tip while still protecting against unexpected concurrent updates.
- Clone the repository
- Download Go dependencies
go mod download- Run lint checks with the same golangci-lint version used in CI
make lint- Run tests
make testIf you prefer to run golangci-lint directly without make, use:
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2 runReleases are managed with git-cliff and Forgejo workflows.
- Conventional commits are pushed to
main. - The
version.ymlworkflow computes the next semantic version, updatesCHANGELOG.mdwith git-cliff, and creates or updates a release PR. - When the release PR is merged,
tag.ymlcreates and pushes the correspondingv*tag. - The tag triggers
release.yml, which builds binaries for Linux (x86_64,arm64,armv7) and Windows (x86_64,arm64) and uploads artifacts plus SHA256 checksums.
To guarantee that a tag pushed by automation can trigger the release workflow in your Forgejo setup, configure the RELEASE_BOT_TOKEN repository secret and use a token with permission to push branches and tags.