Skip to content

Commit

Permalink
Use pcov instead of xdebug for coverage (#948)
Browse files Browse the repository at this point in the history
* Use pcov instead of xdebug for coverage

* enable for infection

* local coverage too
  • Loading branch information
danepowell authored Apr 30, 2022
1 parent a342257 commit a83c7f6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
include:
- os: "ubuntu-latest"
php: "8.1"
coverage: "xdebug"
coverage: "pcov"
steps:
- name: Prepare Git
# Windows corrupts line endings on checkout, causing test failures.
Expand All @@ -47,10 +47,10 @@ jobs:
composer validate --no-check-all --ansi
composer test
- name: Run coverage
if: matrix.coverage == 'xdebug'
if: matrix.coverage == 'pcov'
run: composer coverage
- name: Upload coverage results to Coveralls
if: matrix.coverage == 'xdebug'
if: matrix.coverage == 'pcov'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: composer coveralls
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
with:
php-version: 8.0
tools: composer:v2
extensions: pcov
coverage: pcov

- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@
"curl -f -L https://github.com/infection/infection/releases/download/0.26.0/infection.phar -o build/infection.phar"
],
"infection": [
"XDEBUG_MODE=coverage php build/infection.phar --threads=8"
"php -d pcov.enabled=1 build/infection.phar --threads=8"
],
"cs": "phpcs",
"cbf": "phpcbf",
"unit": "phpunit tests/phpunit -vvv",
"coverage": "XDEBUG_MODE=coverage phpunit tests/phpunit --coverage-clover build/logs/clover.xml",
"coverage": "php -d pcov.enabled=1 vendor/bin/phpunit tests/phpunit --coverage-clover build/logs/clover.xml",
"lint": "phplint",
"test": [
"@lint",
Expand Down

0 comments on commit a83c7f6

Please sign in to comment.