gojekyll
gojekyll copied to clipboard
Add test coverage reporting with Codecov
Description
Add test coverage reporting to CI workflow using Codecov, similar to the liquid project's implementation.
Benefits
- Track test coverage trends over time
- Identify untested code paths
- Prevent coverage regressions in PRs
- Visualize coverage with badges
Implementation
Add a new coverage job to .github/workflows/go.yml that:
- Runs after tests pass
- Only runs on pushes (not PRs to avoid duplicate runs)
- Generates coverage report with
go test -coverprofile=coverage.out ./... - Uploads to Codecov using
codecov/codecov-action@v4 - Set
fail_ci_if_error: falseto not block on Codecov issues
Reference
See liquid project's coverage job: https://github.com/osteele/liquid/blob/main/.github/workflows/go.yml#L40-L66