I want run PHPUnit code coverage using GitLab CI but when i run the command vendor/bin/phpunit --coverage-text --colors=never is only show code test result and not generating code coverage.
When I test it on local using XAMPP with Xdebug enable the code coverage generated with using xdebug.mode=coverage. How to change the xdebug.mode on php.ini on docker setup script ?
I also override it via PHPUnit XML configuration like this also not work.
<ini name="xdebug.mode" value="coverage" />
Here is my .gitlab-ci.yml
image: php:7.4.14
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- vendor
before_script:
# Install git
- apt-get update -yqq
- apt-get install git -yqq
# Install packages
- apt-get install libcurl4-openssl-dev
# Install required php extension
- docker-php-ext-install curl
# Install Xdebug
- pecl install xdebug
- docker-php-ext-enable xdebug
# Install composer
- curl -sS https://getcomposer.org/installer | php
# Install dependencies
- php composer.phar update --prefer-stable --prefer-dist --no-interaction --no-progress
run-test:
script:
- vendor/bin/phpunit --coverage-text --colors=never