CI/QA: start recording code coverage #126
Merged
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.
This commit makes the necessary changes to start recording and uploading code coverage data to Coveralls.
Includes:
test
worflow to run the high/low PHP version builds with code coverage and upload the results.filter
configuration and force the use of@covers
tags.build/*
directory to prevent it being committed.composer.json
file to run code coverage.Notes:
Xdebug
as the code coverage driver.php-coveralls/php-coveralls
package is used to convert the coverage information from a format as generated by PHPUnit to a format as can be consumed by Coveralls. - As this package is only needed for the upload to Coveralls, the package has not been added it to thecomposer.json
file, but will be (global) installed in the GH Actions workflow only. - Thephp-coveralls/php-coveralls
package is not 100% compatible with PHP 8.x (yet), so for uploading the coverage generated using PHP 8.x, we switch to PHP 7.4 for uploading the code coverage reports. - For uploading code coverage with PHP < 5.5,php-coveralls/php-coveralls
1.x
is needed, but that version of the package doesn't play nice with GH Actions. To get round that, the job which runs on PHP < 5.5, will switch to PHP 7.4 for uploading the code coverage reports.COVERALLS_PARALLEL
and COVERALLS_FLAG_NAME` settings are about.coveralls-finish
job will signal to Coveralls that all reports have been uploaded. This basically gives the "okay" to Coveralls to report on the changes in code coverage via a comment on a GitHub PR as well as via a status check.The pertinent Coveralls settings used for this repo are: