- Timestamp:
- 05/22/2026 08:52:59 AM (4 months ago)
- Location:
- trunk/.github/workflows
- Files:
-
- 2 edited
-
reusable-phpunit-tests-v3.yml (modified) (4 diffs)
-
test-coverage.yml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/reusable-phpunit-tests-v3.yml
r62404 r62409 83 83 env: 84 84 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' 87 87 LOCAL_DB_TYPE: ${{ inputs.db-type }} 88 88 LOCAL_DB_VERSION: ${{ inputs.db-version }} … … 114 114 # - Run the PHPUnit tests. 115 115 # - Upload the code coverage report to Codecov.io. 116 # - Upload the HTML code coverage report as an artifact.117 116 # - Ensures version-controlled files are not modified or deleted. 118 117 # - Checks out the WordPress Test reporter repository. … … 202 201 run: npm run env:install 203 202 203 # Installs PCOV as the code coverage driver for the PHPUnit run below. 204 # 205 # The INI directives tune PCOV for WordPress's codebase: 206 # - `pcov.enabled` keeps the Zend hooks active (this is the default, but 207 # stated explicitly for clarity). 208 # - `pcov.directory` restricts instrumentation to `src/`, so PCOV does not 209 # record hits for `vendor/`, `tests/`, or WordPress test fixtures that 210 # PHPUnit would discard at report time anyway. 211 # - `pcov.initial.files` pre-sizes the internal file tracking array for 212 # the thousands of files under `src/`, avoiding reallocation churn 213 # during test warmup. The default of 64 is far too low here. 214 - name: Install PCOV coverage driver 215 if: ${{ inputs.coverage-report }} 216 run: | 217 docker compose exec -T -u 0 php sh -c ' 218 pecl install --force pcov-1.0.12 && 219 docker-php-ext-enable pcov && 220 { 221 echo "pcov.enabled=1" 222 echo "pcov.directory=/var/www/src" 223 echo "pcov.initial.files=10000" 224 } >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini && 225 php -m | grep -i pcov 226 ' 227 204 228 - name: Run PHPUnit tests${{ inputs.phpunit-test-groups && format( ' ({0} groups)', inputs.phpunit-test-groups ) || '' }}${{ inputs.coverage-report && ' with coverage report' || '' }} 205 229 continue-on-error: ${{ inputs.allow-errors }} 206 230 run: | 207 node ./tools/local-env/scripts/docker.js run\231 node ./tools/local-env/scripts/docker.js ${{ inputs.coverage-report && 'exec' || 'run' }} \ 208 232 php ./vendor/bin/phpunit \ 209 233 --verbose \ 210 234 -c "${PHPUNIT_CONFIG}" \ 211 235 ${{ inputs.phpunit-test-groups && '--group "${TEST_GROUPS}"' || '' }} \ 212 ${{ inputs.coverage-report && '--coverage-clover "wp-code-coverage-${MULTISITE_FLAG}-${GITHUB_SHA}.xml" --coverage-html "wp-code-coverage-${MULTISITE_FLAG}-${GITHUB_SHA}"' || '' }}236 ${{ inputs.coverage-report && '--coverage-clover "wp-code-coverage-${MULTISITE_FLAG}-${GITHUB_SHA}.xml"' || '' }} 213 237 env: 214 238 TEST_GROUPS: ${{ inputs.phpunit-test-groups }} … … 244 268 flags: ${{ inputs.multisite && 'multisite' || 'single' }},php 245 269 fail_ci_if_error: true 246 247 - name: Upload HTML coverage report as artifact248 if: ${{ inputs.coverage-report }}249 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1250 with:251 name: wp-code-coverage${{ inputs.multisite && '-multisite' || '-single' }}-${{ github.sha }}252 path: wp-code-coverage${{ inputs.multisite && '-multisite' || '-single' }}-${{ github.sha }}253 overwrite: true254 270 255 271 - name: Ensure version-controlled files are not modified or deleted -
trunk/.github/workflows/test-coverage.yml
r62253 r62409 39 39 40 40 env: 41 LOCAL_PHP_XDEBUG: true42 LOCAL_PHP_XDEBUG_MODE: 'coverage'43 41 LOCAL_PHP_MEMCACHED: false 44 42 PUPPETEER_SKIP_DOWNLOAD: true
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)