feat: add Codecov integration for PR coverage reporting / CodecovによるPRカバレッジレポートの追加#494
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
coverage: pcovtoshivammathur/setup-phpin the CI workflow so PHPUnit can collect coverage data--coverage-clover coverage/clover.xmlcodecov/codecov-action@v5to upload the report to Codecov on every CI runcodecov.ymlwith the following configuration:モチベーション
PRにテストカバレッジの結果が表示されず、カバレッジの推移や低下を把握しにくい状態でした。Codecovを導入することで、PRごとに自動でカバレッジコメントが付き、どの行がカバーされているか・差分でどう変化したかが一目でわかるようになります。
実装内容
shivammathur/setup-phpにcoverage: pcovを追加--coverage-clover coverage/clover.xmlを追加してClover XMLレポートを生成codecov/codecov-action@v5を追加してCIの都度レポートをCodecovへアップロードcodecov.ymlを追加:Setup required / セットアップ手順
CODECOV_TOKENを GitHub のSettings → Secrets → Actions → New repository secretに追加してください。