Add a code coverage badge to CI
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- github-actions, go
- Domain
- ci-cd, documentation
Research direction
Start with the single build-test job in .github/workflows/ci.yml and the CI badge at line 15 of the README. Add go test -coverprofile=coverage.out ./... and read the total with go tool cover -func, then add a push-to-main-only step that needs contents: write. Option A's text is garbled, so confirm with the maintainer which badge option to use. Done means coverage runs on every PR, the badge updates only on main, and the README shows it next to the CI badge.
Written by the indexing model from the issue text.
Description
What
Measure test coverage in CI and surface it as a badge in the README, next to the existing CI badge.
Current state
.github/workflows/ci.yml has one job, build-test, running go build ./..., go vet ./..., a gofmt check, and go test ./.... The README shows the CI badge at the top (line 15).
Proposed change
-
In CI, produce a coverage profile:
go test -coverprofile=coverage.out ./...- total via
go tool cover -func=coverage.out | tail -1(prints something liketotal: (statements) 62.3%).
-
Publish a badge — two options:
Option A — no third party (recommended, fits the project's local-first ethos).
Generate an SVG (for example withgithub.com/AlexBeauchemin/gobadge), commit it to abadgesbranch, and reference it:
coverage
The publish step needspermissions: contents: writeand should run only on push tomain. -
Add the chosen badge to the README next to the CI badge.
Acceptance criteria
- CI computes coverage on every push and PR.
- Badge renders in the README and updates on
main(not on every PR). - Existing CI steps (build, vet, gofmt, test) keep running unchanged.
- Note in the issue/PR that
internal/planandcmd/metcodehave no tests, so the percentage reflects that.
- Dominant language
- Go
- Stars
- 1
- Forks
- 2
- Avg merge
- 1h 31m
- Merged PRs (30d)
- 7
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Edwin-metcalf/MetCode
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Edwin-metcalf/MetCode#18 ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Edwin-metcalf/MetCode#16 ·
-
testing
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Edwin-metcalf/MetCode#9 ·
-
Add a MakefileOpenenhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Edwin-metcalf/MetCode#8 ·
-
Add a --host flagOpenenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Edwin-metcalf/MetCode#7 ·
All issues in Edwin-metcalf/MetCode
Similar issues
-
documentation hacktoberfest priority: low skill: good first issue status: ready for dev
Difficulty 2/5 Half a day Newbie friendliness 85/100
hyperledger-labs/fabric-smart-client#2142 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
numberly/vault-db-injector#107 ·
Maintainers usually reply within 1 day
-
area/import kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
[DOC] Wrong sg_egress_ports range in the Terraform Databricks Guide for AWS Hub & Spoke with Network FirewallPossibly taken @akhil9tiet claimed this today. Opendocs
Difficulty 1/5 Under an hour Newbie friendliness 72/100
databricks/terraform-provider-databricks#6080 · 1 comment ·
Maintainers usually reply within 3 days
-
spqr-coordinator usage shows 'run --config', but 'run' is not a subcommand (unknown command "run")Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pg-sharding/spqr#3092 · 1 comment ·
Maintainers usually reply within 1 day