Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add a code coverage badge to CI

オープン 初心者向け
#19 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
github-actions, go

調査の方向性

.github/workflows/ci.yml の単一のジョブ build-test と、README の 15 行目にある CI バッジから始めてください。go test -coverprofile=coverage.out ./... を追加し、go tool cover -func で合計値を読み取ってください。その後、main への push のみで実行され、contents: write を必要とするステップを追加してください。オプション A の文章は文字化けしているため、どのバッジのオプションを使うかはメンテナーに確認してください。完了条件は、すべての PR でカバレッジが実行されること、バッジが main でのみ更新されること、そして README で CI バッジの隣に表示されることです。

索引モデルが issue の本文から書いたものです。

説明

documentation enhancement help wanted
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
  1. In CI, produce a coverage profile:

    • go test -coverprofile=coverage.out ./...
    • total via go tool cover -func=coverage.out | tail -1 (prints something like total: (statements) 62.3%).
  2. Publish a badge — two options:

    Option A — no third party (recommended, fits the project's local-first ethos).
    Generate an SVG (for example with github.com/AlexBeauchemin/gobadge), commit it to a badges branch, and reference it:
    coverage
    The publish step needs permissions: contents: write and should run only on push to main.

  3. 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/plan and cmd/metcode have no tests, so the percentage reflects that.
主要言語
Go
スター
1
フォーク
2
平均マージ
1時間 31分
マージ済み PR(30日)
7

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Edwin-metcalf/MetCode のほかの issue

Edwin-metcalf/MetCode の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。