Skip to content

Commit

Permalink
Merge pull request #63 from acelaya-forks/feature/xdebug-coverage
Browse files Browse the repository at this point in the history
Switch to xdebug for code coverage reports
  • Loading branch information
acelaya authored Oct 21, 2024
2 parents bf6d37a + 8538f70 commit 8828157
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ on:
jobs:
ci:
uses: shlinkio/github-actions/.github/workflows/php-lib-ci.yml@main
with:
coverage-driver: 'xdebug'
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this

### Changed
* Update to PHPStan 1.11
* Switch to xdebug for code coverage reports, as pcov is not marking functions as covered

### Deprecated
* *Nothing*
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM composer:2

RUN apk add --no-cache libpng-dev libpng libjpeg-turbo-dev libwebp-dev zlib-dev libxpm-dev
RUN docker-php-ext-install gd
RUN apk add --no-cache --virtual .phpize-deps ${PHPIZE_DEPS} && \
pecl install pcov && \
docker-php-ext-enable pcov && \
RUN apk add --update linux-headers && \
apk add --no-cache --virtual .phpize-deps ${PHPIZE_DEPS} && \
pecl install xdebug && \
docker-php-ext-enable xdebug && \
apk del .phpize-deps
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@
"cs:fix": "phpcbf",
"stan": "phpstan analyse",
"test": "phpunit --order-by=random --testdox --testdox-summary",
"test:ci": "@test --coverage-clover=build/clover.xml",
"test:pretty": "@test --coverage-html=build/coverage-html"
"test:ci": [
"@putenv XDEBUG_MODE=coverage",
"@test --coverage-clover=build/clover.xml"
],
"test:pretty": [
"@putenv XDEBUG_MODE=coverage",
"@test --coverage-html=build/coverage-html"
]
},
"scripts-descriptions": {
"ci": "<fg=blue;options=bold>Alias for \"cs\", \"stan\" and \"test:ci\"</>",
Expand Down

0 comments on commit 8828157

Please sign in to comment.