From a18b846b9812a41da7dabe6b19d81614712bf286 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 25 Jun 2026 19:29:20 -0400 Subject: [PATCH 1/9] Configure parallel steps for workflows. --- .../workflows/reusable-check-built-files.yml | 11 ++++++++ .../workflows/reusable-end-to-end-tests.yml | 16 +++++++++--- .../workflows/reusable-phpunit-tests-v3.yml | 25 ++++++++++++++++--- .../reusable-test-core-build-process.yml | 5 ++++ ...sable-test-local-docker-environment-v1.yml | 17 +++++++++++-- 5 files changed, 66 insertions(+), 8 deletions(-) diff --git a/.github/workflows/reusable-check-built-files.yml b/.github/workflows/reusable-check-built-files.yml index 033b2a46ac3e9..e0c6e008b462f 100644 --- a/.github/workflows/reusable-check-built-files.yml +++ b/.github/workflows/reusable-check-built-files.yml @@ -51,6 +51,7 @@ jobs: # passing a custom cache suffix ensures that the cache is flushed at least once per week. - name: Install Composer dependencies uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + background: true with: custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") @@ -62,19 +63,29 @@ jobs: git --version - name: Install npm Dependencies + background: true run: npm ci + - name: Wait for install commands + wait-all: + - name: Run SASS precommit tasks + background: true run: npm run grunt precommit:css - name: Run Emoji precommit task + background: true run: npm run grunt precommit:emoji env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run certificate tasks + background: true run: npm run grunt copy:certificates + - name: Wait for build commands + wait-all: + - name: Build WordPress run: npm run build:dev diff --git a/.github/workflows/reusable-end-to-end-tests.yml b/.github/workflows/reusable-end-to-end-tests.yml index 87f90f1b53039..0a50cc733e54a 100644 --- a/.github/workflows/reusable-end-to-end-tests.yml +++ b/.github/workflows/reusable-end-to-end-tests.yml @@ -103,11 +103,15 @@ jobs: run: npx playwright install --with-deps chromium - name: Build WordPress + background: true run: npm run build - name: Start Docker environment - run: | - npm run env:start + background: true + run: npm run env:start + + - name: Wait for build & Docker commands + wait-all: - name: Log running Docker containers run: docker ps -a @@ -122,12 +126,14 @@ jobs: docker compose run --rm php locale -a - name: Install WordPress + background: true + run: npm run env:install env: LOCAL_SCRIPT_DEBUG: ${{ inputs.LOCAL_SCRIPT_DEBUG }} - run: npm run env:install - name: Install Gutenberg if: ${{ inputs.install-gutenberg }} + background: true run: | npm run env:cli -- plugin install gutenberg \ ${{ inputs.gutenberg-version && '--version="${GUTENBERG_VERSION}"' || '' }} \ @@ -136,11 +142,15 @@ jobs: GUTENBERG_VERSION: ${{ inputs.gutenberg-version }} - name: Install additional languages + background: true run: | npm run env:cli -- language core install de_DE --path="/var/www/${LOCAL_DIR}" npm run env:cli -- language plugin install de_DE --all --path="/var/www/${LOCAL_DIR}" npm run env:cli -- language theme install de_DE --all --path="/var/www/${LOCAL_DIR}" + - name: Wait for install commands + wait-all: + - name: Run E2E tests run: npm run test:e2e diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 7e10a030953a4..8bb9f1162fb47 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -137,6 +137,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + background: true with: node-version-file: '.nvmrc' cache: npm @@ -150,22 +151,36 @@ jobs: ## - name: Set up PHP uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 + background: true with: php-version: '${{ inputs.php }}' coverage: none + - name: Wait for setup steps + wait-all: + # Since Composer dependencies are installed using `composer update` and no lock file is in version control, # passing a custom cache suffix ensures that the cache is flushed at least once per week. - name: Install Composer dependencies uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + background: true with: custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - name: Install npm dependencies + background: true run: npm ci + - name: Wait for install commands + wait-all: + - name: Build WordPress run: npm run build:dev + background: true + + - name: Start Docker environment + background: true + run: npm run env:start - name: General debug information run: | @@ -180,9 +195,8 @@ jobs: run: | docker -v - - name: Start Docker environment - run: | - npm run env:start + - name: Wait for build script & Docker environment + wait-all: - name: Log running Docker containers run: docker ps -a @@ -198,6 +212,7 @@ jobs: LOCAL_DB_CMD: ${{ env.LOCAL_DB_TYPE == 'mariadb' && contains( fromJSON('["5.5", "10.0", "10.1", "10.2", "10.3"]'), env.LOCAL_DB_VERSION ) && 'mysql' || env.LOCAL_DB_TYPE }} - name: Install WordPress + background: true run: npm run env:install # Installs PCOV as the code coverage driver for the PHPUnit run below. @@ -213,6 +228,7 @@ jobs: # during test warmup. The default of 64 is far too low here. - name: Install PCOV coverage driver if: ${{ inputs.coverage-report }} + background: true run: | docker compose exec -T -u 0 php sh -c ' pecl install --force pcov-1.0.12 && @@ -225,6 +241,9 @@ jobs: php -m | grep -i pcov ' + - name: Wait for installation steps + wait-all: + - name: Run external HTTP tests if: ${{ ! inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }} continue-on-error: ${{ inputs.allow-errors }} diff --git a/.github/workflows/reusable-test-core-build-process.yml b/.github/workflows/reusable-test-core-build-process.yml index 1566d1583a807..d71165de83f2b 100644 --- a/.github/workflows/reusable-test-core-build-process.yml +++ b/.github/workflows/reusable-test-core-build-process.yml @@ -87,15 +87,20 @@ jobs: - name: Install Composer dependencies if: ${{ inputs.test-certificates }} uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + background: true with: custom-cache-suffix: ${{ steps.get-date.outputs.date }} - name: Set up Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + background: true with: node-version-file: '.nvmrc' cache: npm + - name: Wait for Node.js & Composer commands + wait-all: + - name: Log debug information run: | npm --version diff --git a/.github/workflows/reusable-test-local-docker-environment-v1.yml b/.github/workflows/reusable-test-local-docker-environment-v1.yml index 8f1a556afa2b4..d2d2629635538 100644 --- a/.github/workflows/reusable-test-local-docker-environment-v1.yml +++ b/.github/workflows/reusable-test-local-docker-environment-v1.yml @@ -93,6 +93,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + background: true with: node-version-file: '.nvmrc' cache: npm @@ -106,21 +107,31 @@ jobs: ## - name: Set up PHP uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 + background: true with: php-version: '${{ inputs.php }}' coverage: none + - name: Wait for setup commands + wait-all: + # Since Composer dependencies are installed using `composer update` and no lock file is in version control, # passing a custom cache suffix ensures that the cache is flushed at least once per week. - name: Install Composer dependencies uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + background: true with: custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - name: Install npm dependencies + background: true run: npm ci + - name: Wait for install commands + wait-all: + - name: Build WordPress + background: true run: npm run build:dev - name: General debug information @@ -137,8 +148,10 @@ jobs: docker -v - name: Start Docker environment - run: | - npm run env:start + run: npm run env:start + + - name: Wait for build script & Docker environment + wait-all: - name: Log running Docker containers run: docker ps -a From 38fca41bf9926ef5655e5c14a8cadea5577a387e Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 25 Jun 2026 20:59:58 -0400 Subject: [PATCH 2/9] Correct step documentation. --- .github/workflows/reusable-phpunit-tests-v3.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 8bb9f1162fb47..047d55acd29e5 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -105,9 +105,10 @@ jobs: # - Sets up PHP. # - Installs Composer dependencies. # - Installs npm dependencies + # - Builds WordPress to run from the `src` directory. + # - Starts the WordPress Docker container. # - Logs general debug information about the runner. # - Logs Docker debug information (about the Docker installation within the runner). - # - Starts the WordPress Docker container. # - Logs the running Docker containers. # - Logs debug information about what's installed within the WordPress Docker containers. # - Install WordPress within the Docker container. From 79d8dde0ea43f111dd277e5c41d8e29e4613bb10 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 25 Jun 2026 21:00:50 -0400 Subject: [PATCH 3/9] Improvements to the order of steps. --- .../workflows/reusable-end-to-end-tests.yml | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/reusable-end-to-end-tests.yml b/.github/workflows/reusable-end-to-end-tests.yml index 0a50cc733e54a..e0fba0e5b48d0 100644 --- a/.github/workflows/reusable-end-to-end-tests.yml +++ b/.github/workflows/reusable-end-to-end-tests.yml @@ -49,8 +49,10 @@ jobs: # - Sets environment variables. # - Checks out the repository. # - Sets up Node.js. - # - Logs debug information about the GitHub Action runner. + # - Sets up PHP. # - Installs npm dependencies. + # - Installs Composer dependencies. + # - Logs debug information about the GitHub Action runner. # - Install Playwright browsers. # - Builds WordPress to run from the `build` directory. # - Starts the WordPress Docker container. @@ -87,6 +89,34 @@ jobs: node-version-file: '.nvmrc' cache: npm + ## + # This allows Composer dependencies to be installed using a single step. + # + # Since the tests are currently run within the Docker containers where the PHP version varies, + # the same PHP version needs to be configured for the action runner machine so that the correct + # dependency versions are installed and cached. + ## + - name: Set up PHP + uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 + background: true + with: + php-version: '${{ inputs.php }}' + coverage: none + + - name: Wait for setup steps + wait-all: + + - name: Install npm Dependencies + run: npm ci + + # Since Composer dependencies are installed using `composer update` and no lock file is in version control, + # passing a custom cache suffix ensures that the cache is flushed at least once per week. + - name: Install Composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + background: true + with: + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") + - name: Log debug information run: | npm --version @@ -95,13 +125,13 @@ jobs: git --version locale -a - - name: Install npm Dependencies - run: npm ci - - name: Install Playwright browsers if: ${{ inputs.install-playwright }} run: npx playwright install --with-deps chromium + - name: Wait for install commands + wait-all: + - name: Build WordPress background: true run: npm run build @@ -126,7 +156,6 @@ jobs: docker compose run --rm php locale -a - name: Install WordPress - background: true run: npm run env:install env: LOCAL_SCRIPT_DEBUG: ${{ inputs.LOCAL_SCRIPT_DEBUG }} @@ -148,7 +177,7 @@ jobs: npm run env:cli -- language plugin install de_DE --all --path="/var/www/${LOCAL_DIR}" npm run env:cli -- language theme install de_DE --all --path="/var/www/${LOCAL_DIR}" - - name: Wait for install commands + - name: Wait for WP-CLI install commands wait-all: - name: Run E2E tests From 2b76acc126f2aa9a276afb906cf4feffd5197544 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 25 Jun 2026 21:12:11 -0400 Subject: [PATCH 4/9] Update `zizmor`. --- .github/workflows/reusable-workflow-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-workflow-lint.yml b/.github/workflows/reusable-workflow-lint.yml index 127a392a2dd28..bd2d624fa1e4d 100644 --- a/.github/workflows/reusable-workflow-lint.yml +++ b/.github/workflows/reusable-workflow-lint.yml @@ -58,7 +58,7 @@ jobs: uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 - name: Run zizmor - run: uvx zizmor@1.24.1 --persona=regular --format=sarif --strict-collection . > results.sarif + run: uvx zizmor@1.26.1 --persona=regular --format=sarif --strict-collection . > results.sarif env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 29b01f82768cbce952f7f785dc138ade6352bcee Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 25 Jun 2026 21:43:05 -0400 Subject: [PATCH 5/9] Switch from shorthand `parallel` grouping. --- .../workflows/reusable-check-built-files.yml | 69 ++++---- .../workflows/reusable-end-to-end-tests.yml | 144 ++++++++-------- .../workflows/reusable-phpunit-tests-v3.yml | 157 ++++++++---------- .../reusable-test-core-build-process.yml | 100 ++++++----- ...sable-test-local-docker-environment-v1.yml | 137 +++++++-------- 5 files changed, 284 insertions(+), 323 deletions(-) diff --git a/.github/workflows/reusable-check-built-files.yml b/.github/workflows/reusable-check-built-files.yml index e0c6e008b462f..29326baf4ba00 100644 --- a/.github/workflows/reusable-check-built-files.yml +++ b/.github/workflows/reusable-check-built-files.yml @@ -18,8 +18,8 @@ jobs: # - Checks out the repository. # - Sets up Node.js. # - Installs Composer dependencies. - # - Logs general debug information about the runner. # - Installs npm dependencies. + # - Logs general debug information about the runner. # - Builds CSS file using SASS. # - Builds Emoji files. # - Builds bundled Root Certificate files. @@ -47,44 +47,35 @@ jobs: node-version-file: '.nvmrc' cache: npm - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, - # passing a custom cache suffix ensures that the cache is flushed at least once per week. - - name: Install Composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - background: true - with: - custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - - - name: Log debug information - run: | - npm --version - node --version - curl --version - git --version - - - name: Install npm Dependencies - background: true - run: npm ci - - - name: Wait for install commands - wait-all: - - - name: Run SASS precommit tasks - background: true - run: npm run grunt precommit:css - - - name: Run Emoji precommit task - background: true - run: npm run grunt precommit:emoji - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Run certificate tasks - background: true - run: npm run grunt copy:certificates - - - name: Wait for build commands - wait-all: + - parallel: + - name: Install npm Dependencies + run: npm ci + + # Since Composer dependencies are installed using `composer update` and no lock file is in version control, + # passing a custom cache suffix ensures that the cache is flushed at least once per week. + - name: Install Composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + with: + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") + + - name: Log debug information + run: | + npm --version + node --version + curl --version + git --version + + - parallel: + - name: Run SASS precommit tasks + run: npm run grunt precommit:css + + - name: Run Emoji precommit task + run: npm run grunt precommit:emoji + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run certificate tasks + run: npm run grunt copy:certificates - name: Build WordPress run: npm run build:dev diff --git a/.github/workflows/reusable-end-to-end-tests.yml b/.github/workflows/reusable-end-to-end-tests.yml index e0fba0e5b48d0..1f1c25dfbee2e 100644 --- a/.github/workflows/reusable-end-to-end-tests.yml +++ b/.github/workflows/reusable-end-to-end-tests.yml @@ -52,8 +52,8 @@ jobs: # - Sets up PHP. # - Installs npm dependencies. # - Installs Composer dependencies. - # - Logs debug information about the GitHub Action runner. # - Install Playwright browsers. + # - Logs debug information about the GitHub Action runner. # - Builds WordPress to run from the `build` directory. # - Starts the WordPress Docker container. # - Logs the running Docker containers. @@ -83,65 +83,55 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false - - name: Set up Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version-file: '.nvmrc' - cache: npm - - ## - # This allows Composer dependencies to be installed using a single step. - # - # Since the tests are currently run within the Docker containers where the PHP version varies, - # the same PHP version needs to be configured for the action runner machine so that the correct - # dependency versions are installed and cached. - ## - - name: Set up PHP - uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 - background: true - with: - php-version: '${{ inputs.php }}' - coverage: none - - - name: Wait for setup steps - wait-all: - - - name: Install npm Dependencies - run: npm ci - - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, - # passing a custom cache suffix ensures that the cache is flushed at least once per week. - - name: Install Composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - background: true - with: - custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - - - name: Log debug information - run: | - npm --version - node --version - curl --version - git --version - locale -a - - - name: Install Playwright browsers - if: ${{ inputs.install-playwright }} - run: npx playwright install --with-deps chromium - - - name: Wait for install commands - wait-all: - - - name: Build WordPress - background: true - run: npm run build - - - name: Start Docker environment - background: true - run: npm run env:start - - - name: Wait for build & Docker commands - wait-all: + - parallel: + - name: Set up Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version-file: '.nvmrc' + cache: npm + + ## + # This allows Composer dependencies to be installed using a single step. + # + # Since the tests are currently run within the Docker containers where the PHP version varies, + # the same PHP version needs to be configured for the action runner machine so that the correct + # dependency versions are installed and cached. + ## + - name: Set up PHP + uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 + with: + php-version: '${{ inputs.php }}' + coverage: none + + - parallel: + - name: Install npm Dependencies + run: npm ci + + # Since Composer dependencies are installed using `composer update` and no lock file is in version control, + # passing a custom cache suffix ensures that the cache is flushed at least once per week. + - name: Install Composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + with: + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") + + - name: Install Playwright browsers + if: ${{ inputs.install-playwright }} + run: npx playwright install --with-deps chromium + + - name: Log debug information + run: | + npm --version + node --version + curl --version + git --version + locale -a + + - parallel: + - name: Build WordPress + run: npm run build + + - name: Start Docker environment + run: npm run env:start - name: Log running Docker containers run: docker ps -a @@ -160,25 +150,21 @@ jobs: env: LOCAL_SCRIPT_DEBUG: ${{ inputs.LOCAL_SCRIPT_DEBUG }} - - name: Install Gutenberg - if: ${{ inputs.install-gutenberg }} - background: true - run: | - npm run env:cli -- plugin install gutenberg \ - ${{ inputs.gutenberg-version && '--version="${GUTENBERG_VERSION}"' || '' }} \ - --path="/var/www/${LOCAL_DIR}" - env: - GUTENBERG_VERSION: ${{ inputs.gutenberg-version }} - - - name: Install additional languages - background: true - run: | - npm run env:cli -- language core install de_DE --path="/var/www/${LOCAL_DIR}" - npm run env:cli -- language plugin install de_DE --all --path="/var/www/${LOCAL_DIR}" - npm run env:cli -- language theme install de_DE --all --path="/var/www/${LOCAL_DIR}" - - - name: Wait for WP-CLI install commands - wait-all: + - parallel: + - name: Install Gutenberg + if: ${{ inputs.install-gutenberg }} + run: | + npm run env:cli -- plugin install gutenberg \ + ${{ inputs.gutenberg-version && '--version="${GUTENBERG_VERSION}"' || '' }} \ + --path="/var/www/${LOCAL_DIR}" + env: + GUTENBERG_VERSION: ${{ inputs.gutenberg-version }} + + - name: Install additional languages + run: | + npm run env:cli -- language core install de_DE --path="/var/www/${LOCAL_DIR}" + npm run env:cli -- language plugin install de_DE --all --path="/var/www/${LOCAL_DIR}" + npm run env:cli -- language theme install de_DE --all --path="/var/www/${LOCAL_DIR}" - name: Run E2E tests run: npm run test:e2e diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 047d55acd29e5..80f562d2dbea3 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -112,6 +112,7 @@ jobs: # - Logs the running Docker containers. # - Logs debug information about what's installed within the WordPress Docker containers. # - Install WordPress within the Docker container. + # - Install the PCOV code coverage driver. # - Run the PHPUnit tests. # - Upload the code coverage report to Codecov.io. # - Ensures version-controlled files are not modified or deleted. @@ -136,68 +137,56 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false - - name: Set up Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - background: true - with: - node-version-file: '.nvmrc' - cache: npm - - ## - # This allows Composer dependencies to be installed using a single step. - # - # Since the tests are currently run within the Docker containers where the PHP version varies, - # the same PHP version needs to be configured for the action runner machine so that the correct - # dependency versions are installed and cached. - ## - - name: Set up PHP - uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 - background: true - with: - php-version: '${{ inputs.php }}' - coverage: none + - parallel: + - name: Set up Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version-file: '.nvmrc' + cache: npm - - name: Wait for setup steps - wait-all: + ## + # This allows Composer dependencies to be installed using a single step. + # + # Since the tests are currently run within the Docker containers where the PHP version varies, + # the same PHP version needs to be configured for the action runner machine so that the correct + # dependency versions are installed and cached. + ## + - name: Set up PHP + uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 + with: + php-version: '${{ inputs.php }}' + coverage: none - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, - # passing a custom cache suffix ensures that the cache is flushed at least once per week. - - name: Install Composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - background: true - with: - custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") + - parallel: + # Since Composer dependencies are installed using `composer update` and no lock file is in version control, + # passing a custom cache suffix ensures that the cache is flushed at least once per week. + - name: Install Composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + with: + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - - name: Install npm dependencies - background: true - run: npm ci + - name: Install npm dependencies + run: npm ci - - name: Wait for install commands - wait-all: + - parallel: + - name: Build WordPress + run: npm run build:dev - - name: Build WordPress - run: npm run build:dev - background: true + - name: Start Docker environment + run: npm run env:start - - name: Start Docker environment - background: true - run: npm run env:start + - name: General debug information + run: | + npm --version + node --version + curl --version + git --version + composer --version + locale -a - - name: General debug information - run: | - npm --version - node --version - curl --version - git --version - composer --version - locale -a - - - name: Docker debug information - run: | - docker -v - - - name: Wait for build script & Docker environment - wait-all: + - name: Docker debug information + run: | + docker -v - name: Log running Docker containers run: docker ps -a @@ -212,38 +201,34 @@ jobs: env: LOCAL_DB_CMD: ${{ env.LOCAL_DB_TYPE == 'mariadb' && contains( fromJSON('["5.5", "10.0", "10.1", "10.2", "10.3"]'), env.LOCAL_DB_VERSION ) && 'mysql' || env.LOCAL_DB_TYPE }} - - name: Install WordPress - background: true - run: npm run env:install - - # Installs PCOV as the code coverage driver for the PHPUnit run below. - # - # The INI directives tune PCOV for WordPress's codebase: - # - `pcov.enabled` keeps the Zend hooks active (this is the default, but - # stated explicitly for clarity). - # - `pcov.directory` restricts instrumentation to `src/`, so PCOV does not - # record hits for `vendor/`, `tests/`, or WordPress test fixtures that - # PHPUnit would discard at report time anyway. - # - `pcov.initial.files` pre-sizes the internal file tracking array for - # the thousands of files under `src/`, avoiding reallocation churn - # during test warmup. The default of 64 is far too low here. - - name: Install PCOV coverage driver - if: ${{ inputs.coverage-report }} - background: true - run: | - docker compose exec -T -u 0 php sh -c ' - pecl install --force pcov-1.0.12 && - docker-php-ext-enable pcov && - { - echo "pcov.enabled=1" - echo "pcov.directory=/var/www/src" - echo "pcov.initial.files=10000" - } >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini && - php -m | grep -i pcov - ' + - parallel: + - name: Install WordPress + run: npm run env:install - - name: Wait for installation steps - wait-all: + # Installs PCOV as the code coverage driver for the PHPUnit run below. + # + # The INI directives tune PCOV for WordPress's codebase: + # - `pcov.enabled` keeps the Zend hooks active (this is the default, but + # stated explicitly for clarity). + # - `pcov.directory` restricts instrumentation to `src/`, so PCOV does not + # record hits for `vendor/`, `tests/`, or WordPress test fixtures that + # PHPUnit would discard at report time anyway. + # - `pcov.initial.files` pre-sizes the internal file tracking array for + # the thousands of files under `src/`, avoiding reallocation churn + # during test warmup. The default of 64 is far too low here. + - name: Install PCOV coverage driver + if: ${{ inputs.coverage-report }} + run: | + docker compose exec -T -u 0 php sh -c ' + pecl install --force pcov-1.0.12 && + docker-php-ext-enable pcov && + { + echo "pcov.enabled=1" + echo "pcov.directory=/var/www/src" + echo "pcov.initial.files=10000" + } >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini && + php -m | grep -i pcov + ' - name: Run external HTTP tests if: ${{ ! inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }} diff --git a/.github/workflows/reusable-test-core-build-process.yml b/.github/workflows/reusable-test-core-build-process.yml index d71165de83f2b..f45c7b087b2c6 100644 --- a/.github/workflows/reusable-test-core-build-process.yml +++ b/.github/workflows/reusable-test-core-build-process.yml @@ -51,8 +51,12 @@ jobs: # Performs the following steps: # - Checks out the repository. # - Sets up Node.js. - # - Logs debug information about the GitHub Action runner. + # - Sets up PHP. + # - Installs Composer dependencies. # - Installs npm dependencies. + # - Logs debug information about the GitHub Action runner. + # - Runs Emoji build scripts. + # - Runs bundled Root Certificate build scripts. # - Builds WordPress to run from the desired location (src or build). # - Ensures version-controlled files are not modified or deleted. # - Creates a ZIP of the built WordPress files (when building to the build directory). @@ -75,51 +79,55 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false - # This date is used to ensure that the PHPCS cache is cleared at least once every week. - # http://man7.org/linux/man-pages/man1/date.1.html - - name: "Get last Monday's date" - id: get-date - if: ${{ inputs.test-certificates }} - run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT" - - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, - # passing a custom cache suffix ensures that the cache is flushed at least once per week. - - name: Install Composer dependencies - if: ${{ inputs.test-certificates }} - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - background: true - with: - custom-cache-suffix: ${{ steps.get-date.outputs.date }} - - - name: Set up Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - background: true - with: - node-version-file: '.nvmrc' - cache: npm - - - name: Wait for Node.js & Composer commands - wait-all: - - - name: Log debug information - run: | - npm --version - node --version - curl --version - git --version - - - name: Install npm Dependencies - run: npm ci - - - name: Run Emoji precommit task - if: ${{ inputs.test-emoji }} - run: npm run grunt precommit:emoji - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Ensure certificates files are updated - if: ${{ inputs.test-certificates }} - run: npm run grunt copy:certificates && npm run grunt build:certificates + - parallel: + - name: Set up Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version-file: '.nvmrc' + cache: npm + + ## + # This allows Composer dependencies to be installed using a single step. + # + # Since the tests are currently run within the Docker containers where the PHP version varies, + # the same PHP version needs to be configured for the action runner machine so that the correct + # dependency versions are installed and cached. + ## + - name: Set up PHP + uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 + with: + php-version: '8.3' + coverage: none + + - parallel: + # Since Composer dependencies are installed using `composer update` and no lock file is in version control, + # passing a custom cache suffix ensures that the cache is flushed at least once per week. + - name: Install Composer dependencies + if: ${{ inputs.test-certificates }} + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + with: + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") + + - name: Install npm Dependencies + run: npm ci + + - name: Log debug information + run: | + npm --version + node --version + curl --version + git --version + + - parallel: + - name: Run Emoji precommit task + if: ${{ inputs.test-emoji }} + run: npm run grunt precommit:emoji + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Ensure certificates files are updated + if: ${{ inputs.test-certificates }} + run: npm run grunt copy:certificates && npm run grunt build:certificates - name: Build WordPress to run from ${{ inputs.directory }} run: npm run ${{ inputs.directory == 'src' && 'build:dev' || 'build' }} diff --git a/.github/workflows/reusable-test-local-docker-environment-v1.yml b/.github/workflows/reusable-test-local-docker-environment-v1.yml index d2d2629635538..5d51b5b5012e5 100644 --- a/.github/workflows/reusable-test-local-docker-environment-v1.yml +++ b/.github/workflows/reusable-test-local-docker-environment-v1.yml @@ -61,9 +61,10 @@ jobs: # - Sets up PHP. # - Installs Composer dependencies. # - Installs npm dependencies + # - Builds WordPress to run from `src/` + # - Starts the WordPress Docker container. # - Logs general debug information about the runner. # - Logs Docker debug information (about the Docker installation within the runner). - # - Starts the WordPress Docker container. # - Logs the running Docker containers. # - Logs debug information about what's installed within the WordPress Docker containers. # - Install WordPress within the Docker container. @@ -91,78 +92,68 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false - - name: Set up Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - background: true - with: - node-version-file: '.nvmrc' - cache: npm - - ## - # This allows Composer dependencies to be installed using a single step. - # - # Since tests are currently run within the Docker containers where the PHP version varies, - # the same PHP version needs to be configured for the action runner machine so that the correct - # dependency versions are installed and cached. - ## - - name: Set up PHP - uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 - background: true - with: - php-version: '${{ inputs.php }}' - coverage: none - - - name: Wait for setup commands - wait-all: - - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, - # passing a custom cache suffix ensures that the cache is flushed at least once per week. - - name: Install Composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - background: true - with: - custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - - - name: Install npm dependencies - background: true - run: npm ci - - - name: Wait for install commands - wait-all: - - - name: Build WordPress - background: true - run: npm run build:dev - - - name: General debug information - run: | - npm --version - node --version - curl --version - git --version - composer --version - locale -a - - - name: Docker debug information - run: | - docker -v - - - name: Start Docker environment - run: npm run env:start - - - name: Wait for build script & Docker environment - wait-all: - - - name: Log running Docker containers - run: docker ps -a - - - name: WordPress Docker container debug information - run: | - docker compose run --rm mysql "${LOCAL_DB_TYPE}" --version - docker compose run --rm php php --version - docker compose run --rm php php -m - docker compose run --rm php php -i - docker compose run --rm php locale -a + - parallel: + - name: Set up Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version-file: '.nvmrc' + cache: npm + + ## + # This allows Composer dependencies to be installed using a single step. + # + # Since tests are currently run within the Docker containers where the PHP version varies, + # the same PHP version needs to be configured for the action runner machine so that the correct + # dependency versions are installed and cached. + ## + - name: Set up PHP + uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 + with: + php-version: '${{ inputs.php }}' + coverage: none + + - parallel: + # Since Composer dependencies are installed using `composer update` and no lock file is in version control, + # passing a custom cache suffix ensures that the cache is flushed at least once per week. + - name: Install Composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + with: + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") + + - name: Install npm dependencies + run: npm ci + + - parallel: + - name: Build WordPress + run: npm run build:dev + + - name: Start Docker environment + run: npm run env:start + + - name: General debug information + run: | + npm --version + node --version + curl --version + git --version + composer --version + locale -a + + - name: Docker debug information + run: | + docker -v + + - parallel: + - name: Log running Docker containers + run: docker ps -a + + - name: WordPress Docker container debug information + run: | + docker compose run --rm mysql "${LOCAL_DB_TYPE}" --version + docker compose run --rm php php --version + docker compose run --rm php php -m + docker compose run --rm php php -i + docker compose run --rm php locale -a - name: Install WordPress run: npm run env:install From 12b18c6a5787de0fa395cc9cd3c69fa22a4ef568 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 25 Jun 2026 21:45:37 -0400 Subject: [PATCH 6/9] `setup-php`'s `latest` != Docker container `latest`. --- .github/workflows/reusable-test-local-docker-environment-v1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-test-local-docker-environment-v1.yml b/.github/workflows/reusable-test-local-docker-environment-v1.yml index 5d51b5b5012e5..9b65049e5b983 100644 --- a/.github/workflows/reusable-test-local-docker-environment-v1.yml +++ b/.github/workflows/reusable-test-local-docker-environment-v1.yml @@ -109,7 +109,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 with: - php-version: '${{ inputs.php }}' + php-version: '${{ inputs.php == 'latest' && '8.3' || inputs.php }}' coverage: none - parallel: From d4db00107dd3f38be921de71544ee8b2bb9c7c70 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 25 Jun 2026 21:50:31 -0400 Subject: [PATCH 7/9] `setup-php`'s `latest` != Docker's. --- .github/workflows/reusable-phpunit-tests-v3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 80f562d2dbea3..df145546998a4 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -154,7 +154,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 with: - php-version: '${{ inputs.php }}' + php-version: '${{ inputs.php == 'latest' && '8.3' || inputs.php }}' coverage: none - parallel: From e9abf99d4eb34e9ee5743d0ac9e88a7377c95bc0 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 25 Jun 2026 21:53:43 -0400 Subject: [PATCH 8/9] Fix syntax error. --- .github/workflows/reusable-phpunit-tests-v3.yml | 2 +- .github/workflows/reusable-test-local-docker-environment-v1.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index df145546998a4..d76eef59a0da2 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -154,7 +154,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 with: - php-version: '${{ inputs.php == 'latest' && '8.3' || inputs.php }}' + php-version: ${{ inputs.php == 'latest' && '8.3' || inputs.php }} coverage: none - parallel: diff --git a/.github/workflows/reusable-test-local-docker-environment-v1.yml b/.github/workflows/reusable-test-local-docker-environment-v1.yml index 9b65049e5b983..7864508ea56f4 100644 --- a/.github/workflows/reusable-test-local-docker-environment-v1.yml +++ b/.github/workflows/reusable-test-local-docker-environment-v1.yml @@ -109,7 +109,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 with: - php-version: '${{ inputs.php == 'latest' && '8.3' || inputs.php }}' + php-version: ${{ inputs.php == 'latest' && '8.3' || inputs.php }} coverage: none - parallel: From edd29991ec2a7c120d3ea18f9a78cf09b35674ac Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 25 Jun 2026 22:17:39 -0400 Subject: [PATCH 9/9] Add parallelization to PHPStan workflow. --- .../reusable-phpstan-static-analysis-v1.yml | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/.github/workflows/reusable-phpstan-static-analysis-v1.yml b/.github/workflows/reusable-phpstan-static-analysis-v1.yml index c73c1e5e692fe..58c66db1b3c97 100644 --- a/.github/workflows/reusable-phpstan-static-analysis-v1.yml +++ b/.github/workflows/reusable-phpstan-static-analysis-v1.yml @@ -48,38 +48,40 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} persist-credentials: false - - name: Set up Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version-file: '.nvmrc' - cache: npm + - parallel: + - name: Set up Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version-file: '.nvmrc' + cache: npm - - name: Set up PHP - uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 - with: - php-version: ${{ inputs.php-version }} - coverage: none - tools: cs2pr + - name: Set up PHP + uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1 + with: + php-version: ${{ inputs.php-version }} + coverage: none + tools: cs2pr - - name: General debug information - run: | - npm --version - node --version - composer --version + - parallel: + # Since Composer dependencies are installed using `composer update` and no lock file is in version control, + # passing a custom cache suffix ensures that the cache is flushed at least once per week. + - name: Install Composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + with: + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, - # passing a custom cache suffix ensures that the cache is flushed at least once per week. - - name: Install Composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - with: - custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") + - name: Install npm dependencies + run: npm ci --ignore-scripts + + - name: General debug information + run: | + npm --version + node --version + composer --version - name: Make Composer packages available globally run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH" - - name: Install npm dependencies - run: npm ci --ignore-scripts - - name: Build WordPress run: npm run build:dev