Skip to content

Coverage: publish the report with the site - #45

Merged
floatdrop merged 2 commits into
mainfrom
codecov
Sep 10, 2026
Merged

Coverage: publish the report with the site#45
floatdrop merged 2 commits into
mainfrom
codecov

Conversation

@floatdrop

@floatdrop floatdrop commented Sep 10, 2026

Copy link
Copy Markdown
Owner

awesome-go asks a submission for a link to a coverage report, and there was
none to give: the number existed only in a CI log.

Codecov turned out to be a dead end — its login returns 403 — so the first
commit here is superseded by the second. awesome-go's own COVERAGE.md
suggests tj-actions/coverage-badge-go, which rewrites the README from CI and
commits it back to main on every push; that bypasses the pull-request
process this repo otherwise follows, and adds a dependency on an action whose
sibling was compromised last year.

So the report goes where this repo already publishes. pages.yml writes
go tool cover -html and a shields endpoint JSON into site/build after the
site is built and before the artifact is uploaded:

The report and the badge are one deploy and cannot disagree, there is nothing
to log into, and no CI job commits to main. It covers di, dihttp and
dislogexamples/ and benchmarks/ are separate modules and not part of
the library's number, which is 97.6% of statements locally.

The site's path filter gains **/*.go, because coverage moves when the
library or its tests do, so a Go change now deploys the site. That is the
thing to remember when the badge looks stale, and it is written down in both
CLAUDE.md and site/README.md — whose count of things worth knowing goes
to eight.

The colour thresholds were checked under bash -e, the shell Actions uses:
an awk … && color=… chain aborts the step if the failing awk lands
outside the position bash exempts. Five coverage figures were run through it,
and each picks its colour and reaches the end.

No library change, so no CHANGELOG entry.

awesome-go asks a submission for a link to a coverage report, and there was
none to give: the number existed only in a CI log. The profile the test step
already writes is uploaded now, so the badge is the library's real coverage
and the link is somewhere to read it.

It covers di, dihttp and dislog. examples/ and benchmarks/ are separate
modules and not part of the library's number, which is what the split bought.

The upload runs with fail_ci_if_error: false. An outage at Codecov is not a
reason to fail a build, so a missing report is a stale badge and never a red
gate.

The badge stays unknown until the repository is activated at codecov.io and
the first upload from main lands.
Codecov could not be activated -- its login returns 403 -- so the badge the
previous commit added would have read unknown forever. awesome-go's own
COVERAGE.md suggests tj-actions/coverage-badge-go instead, which rewrites the
README from CI and commits it back to main on every push; that bypasses the
pull-request process this repo otherwise follows, and adds a dependency on an
action whose sibling was compromised last year.

So the report goes where this repo already publishes: pages.yml writes
go tool cover -html and a shields endpoint JSON into site/build after the
site is built and before the artifact is uploaded, and the badge in the README
points at both. The report and the badge are one deploy and cannot disagree,
there is nothing to log into, and no CI job commits to main.

The site's path filter gains **/*.go, because coverage moves when the library
or its tests do. That is the thing to remember when the badge looks stale: it
is documented in CLAUDE.md and in site/README.md, whose count of things worth
knowing goes to eight.

The colour thresholds were checked under bash -e, which is the shell Actions
uses: an awk && color= chain aborts the step if the failing awk is not in the
position bash exempts. Five coverage figures were run through it, and each
picks its colour and reaches the end.
@floatdrop floatdrop changed the title CI: publish coverage to Codecov, and a badge for it Coverage: publish the report with the site Sep 10, 2026
@floatdrop
floatdrop merged commit 4f83c58 into main Sep 10, 2026
4 checks passed
@floatdrop
floatdrop deleted the codecov branch September 10, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant