Skip to content

Commit

Permalink
Merge pull request #39 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 db92d41 + 1de7706 commit f7666f9
Show file tree
Hide file tree
Showing 4 changed files with 25 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'
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org).

## [Unreleased]
### Added
* *Nothing*

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

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* *Nothing*


## [3.2.1] - 2024-10-17
### Added
* *Nothing*
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM composer:2

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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"cs:fix": "phpcbf",
"stan": "phpstan analyse",
"test": "phpunit --order-by=random --testdox --testdox-summary",
"test:ci": "@test --coverage-clover=build/clover.xml --coverage-xml=build/coverage-xml --log-junit=build/junit.xml",
"test:pretty": "@test --coverage-html build/coverage-html"
"test:ci": "XDEBUG_MODE=coverage composer test -- --coverage-clover=build/clover.xml --coverage-xml=build/coverage-xml",
"test:pretty": "XDEBUG_MODE=coverage composer 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 f7666f9

Please sign in to comment.