Closed g105b closed 3 years ago
One suggestion: Just add xdebug.mode=coverage
to the php.ini. Regardless it is needed or not, but this should not have any impact if xdebug is not installed
I think that might be a decent solution, @Gared , but I thought -d
should work as this is used. Maybe adding to the ini on the action runner will be simple enough to resolve this.
@g105b I'm running into the same issue. How did you add -d
?
I tried putting -d xdebug.mode=coverage into args
but I'm getting the same message to set xdebug.mode
or XDEBUG_MODE
.
Hi @lamalex , @estahn and @Gared ,
I have a solution and have documented it. This has been bugging me for a while, but despite what the phpunit documentation says, I couldn't get the -d
flag to work at all.
The solution is to pass the environment variable XDEBUG_MODE
to the Github Action.
With this configuration (live example):
name: CI-coverage
on: [push]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: php-actions/composer@v5
- name: PHPUnit Tests
uses: php-actions/phpunit@v2
with:
php_extensions: xdebug
bootstrap: vendor/autoload.php
configuration: test/phpunit.xml
args: --coverage-text
env:
XDEBUG_MODE: coverage
I can see this test run output (live example):
I hope this answers everything. If you have any other questions please feel free to re-open the issue - always happy to help out, but sorry it's taken me a while to give you a response.
Cheers, Greg.
When running with code coverage, as on this repository, a warning is raised:
Warning: XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set
This is despite having the xdebug extension enabled, and doesn't seem to be affected by passing
-d XDEBUG_MODE=coverage
.Tracking this issue here to fix once the other php-actions are running happily alongside each other.