Skip to content

feat: add Codecov integration for PR coverage reporting / CodecovによるPRカバレッジレポートの追加#494

Merged
zigzagdev merged 1 commit into
feat/user_registerfrom
feat/codecov-integration
Jun 28, 2026
Merged

feat: add Codecov integration for PR coverage reporting / CodecovによるPRカバレッジレポートの追加#494
zigzagdev merged 1 commit into
feat/user_registerfrom
feat/codecov-integration

Conversation

@zigzagdev

Copy link
Copy Markdown
Owner

Motivation

Test coverage results were not visible on pull requests, making it difficult to track coverage trends and catch regressions. Integrating Codecov provides automatic coverage comments on every PR, showing exactly which lines are covered and how coverage changes with each diff.

Resolves #493

What I have done

  • Added coverage: pcov to shivammathur/setup-php in the CI workflow so PHPUnit can collect coverage data
  • Updated the test step to generate a Clover XML report via --coverage-clover coverage/clover.xml
  • Added codecov/codecov-action@v5 to upload the report to Codecov on every CI run
  • Added codecov.yml with the following configuration:
    • project: auto-detect base coverage, allow 1% drop threshold
    • patch: require 80% coverage on changed lines per PR

モチベーション

PRにテストカバレッジの結果が表示されず、カバレッジの推移や低下を把握しにくい状態でした。Codecovを導入することで、PRごとに自動でカバレッジコメントが付き、どの行がカバーされているか・差分でどう変化したかが一目でわかるようになります。

実装内容

  • CIワークフローの shivammathur/setup-phpcoverage: pcov を追加
  • テストステップに --coverage-clover coverage/clover.xml を追加してClover XMLレポートを生成
  • codecov/codecov-action@v5 を追加してCIの都度レポートをCodecovへアップロード
  • codecov.yml を追加:
    • project: ベースカバレッジを自動検出、1%の低下まで許容
    • patch: PRの変更行に対して80%以上のカバレッジを要求

Setup required / セットアップ手順

CODECOV_TOKEN を GitHub の Settings → Secrets → Actions → New repository secret に追加してください。

@zigzagdev zigzagdev self-assigned this Jun 28, 2026
@zigzagdev zigzagdev changed the base branch from main to feat/user_register June 28, 2026 11:13
zigzagdev

This comment was marked as low quality.

@zigzagdev zigzagdev merged commit fa882fd into feat/user_register Jun 28, 2026
1 check passed
@zigzagdev zigzagdev deleted the feat/codecov-integration branch June 28, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate Codecov for test coverage reporting on PRs

1 participant