Skip to content

Commit 1430ff2

Browse files
committed
Switch to PCOV for the coverage report runner.
1 parent 67094ee commit 1430ff2

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/reusable-phpunit-tests-v3.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ on:
8282

8383
env:
8484
LOCAL_PHP: ${{ inputs.php }}-fpm
85-
LOCAL_PHP_XDEBUG: ${{ inputs.coverage-report || false }}
86-
LOCAL_PHP_XDEBUG_MODE: ${{ inputs.coverage-report && 'coverage' || 'develop,debug' }}
85+
LOCAL_PHP_XDEBUG: false
86+
LOCAL_PHP_XDEBUG_MODE: 'develop,debug'
8787
LOCAL_DB_TYPE: ${{ inputs.db-type }}
8888
LOCAL_DB_VERSION: ${{ inputs.db-version }}
8989
LOCAL_PHP_MEMCACHED: ${{ inputs.memcached }}
@@ -201,10 +201,21 @@ jobs:
201201
- name: Install WordPress
202202
run: npm run env:install
203203

204+
- name: Install PCOV coverage driver
205+
if: ${{ inputs.coverage-report }}
206+
run: |
207+
docker compose exec -T -u 0 php sh -c '
208+
apt-get update -qq &&
209+
apt-get install -y -qq --no-install-recommends $PHPIZE_DEPS &&
210+
pecl install pcov &&
211+
docker-php-ext-enable pcov &&
212+
php -m | grep -i pcov
213+
'
214+
204215
- name: Run PHPUnit tests${{ inputs.phpunit-test-groups && format( ' ({0} groups)', inputs.phpunit-test-groups ) || '' }}${{ inputs.coverage-report && ' with coverage report' || '' }}
205216
continue-on-error: ${{ inputs.allow-errors }}
206217
run: |
207-
node ./tools/local-env/scripts/docker.js run \
218+
node ./tools/local-env/scripts/docker.js ${{ inputs.coverage-report && 'exec' || 'run' }} \
208219
php ./vendor/bin/phpunit \
209220
--verbose \
210221
-c "${PHPUNIT_CONFIG}" \

.github/workflows/test-coverage.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ concurrency:
3838
permissions: {}
3939

4040
env:
41-
LOCAL_PHP_XDEBUG: true
42-
LOCAL_PHP_XDEBUG_MODE: 'coverage'
4341
LOCAL_PHP_MEMCACHED: ${{ false }}
4442
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
4543

@@ -52,7 +50,7 @@ jobs:
5250
uses: ./.github/workflows/reusable-phpunit-tests-v3.yml
5351
permissions:
5452
contents: read
55-
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
53+
# if: ${{ github.repository == 'WordPress/wordpress-develop' }}
5654
strategy:
5755
fail-fast: false
5856
matrix:

0 commit comments

Comments
 (0)