Skip to content

Upload coverage report artifacts#5950

Draft
staabm wants to merge 7 commits into
phpstan:2.2.xfrom
staabm:artup
Draft

Upload coverage report artifacts#5950
staabm wants to merge 7 commits into
phpstan:2.2.xfrom
staabm:artup

Conversation

@staabm

@staabm staabm commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

goal: make code-coverage data re-usable for use in coverage-guard


idea is to have the coverage data available in every pull request.

this data can for example be used

  • for later post processing (e.g. in coverage-guard)
  • for running infection locally

... without the need for creating the report locally, which is slow and requires additional tooling setup


artifacts can be downloaded with one of

  • via github.com web UI
  • github command line gh run download <run-id> --repo=phpstan/phpstan-src or gh run download <run-id> -n <name> --repo=phpstan/phpstan-src

caveat

since we are using PHPUnit 12 the coverage data beeing generated contains GitHub Action Runner local file paths. this means to use the data locally you need to replace paths within coverage data to match your local filesystem.

Starting with PHPUnit 13 paths in coverage data will no longer be recording environment specific and should be easier to reuse without additional processing, see https://phpunit.expert/articles/merging-code-coverage-data.html

I tried updating phpstan-src CI to PHPUnit 13, but this is blocked on ondrejmirtes/php-merge being compatible with sebastian/diff: ^8, and this is blocked on updating the GitWrapper used in php-merge, as the currently used one is abondend.


related PHPStorm issues

@staabm staabm changed the title Upload coverage reports artifacts Upload coverage report artifacts Jun 29, 2026
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