From 78d727761433b392f055665196fa8e0695096ca5 Mon Sep 17 00:00:00 2001 From: "vivi-the-going-merry[bot]" <308115520+vivi-the-going-merry[bot]@users.noreply.github.com> Date: Thu, 17 Sep 2026 09:47:28 -0600 Subject: [PATCH 1/2] Run PHPUnit CI against WP trunk, build core JS/CSS assets first Fixes test_FrmStylesController::test_front_head on trunk: wp_head()'s wp_maybe_inline_styles() can't find wp-commands' dist stylesheet because develop.git.wordpress.org's tree only holds source, not build output. Add an npm build:dev step (matching WP core's own CI) before running PHPUnit, matrix wordpress: 6.9 -> trunk. --- .github/workflows/phpunit.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 367ae8c4a5..84c3dbdc67 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -25,10 +25,10 @@ jobs: matrix: include: - php: 7.4 - wordpress: 6.9 + wordpress: trunk multisite: 0 - php: 8.0 - wordpress: 6.9 + wordpress: trunk multisite: 0 name: PHP ${{ matrix.php }} tests in WP ${{ matrix.wordpress }} @@ -53,6 +53,19 @@ jobs: sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php sed -i "s/yourusernamehere/root/" wp-tests-config.php sed -i "s/yourpasswordhere/root/" wp-tests-config.php + + - name: Set up Node.js for WP core assets + uses: actions/setup-node@v5 + with: + node-version-file: /tmp/wordpress/.nvmrc + + - name: Building WP core assets + # Core's dist JS/CSS isn't checked into git; missing it fails wp_head()'s + # wp_maybe_inline_styles() check (test_front_head). + run: | + cd /tmp/wordpress + npm ci + npm run build:dev - name: Creating database run: | sudo /etc/init.d/mysql start From c56cf5a5c5251591a1a359941dad994d8052d35d Mon Sep 17 00:00:00 2001 From: "vivi-the-going-merry[bot]" <308115520+vivi-the-going-merry[bot]@users.noreply.github.com> Date: Thu, 17 Sep 2026 09:49:12 -0600 Subject: [PATCH 2/2] Read WP core's .nvmrc explicitly instead of node-version-file setup-node's node-version-file resolves relative to GITHUB_WORKSPACE, so an absolute path outside the checkout doesn't work. --- .github/workflows/phpunit.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 84c3dbdc67..07b8ddfce1 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -54,10 +54,14 @@ jobs: sed -i "s/yourusernamehere/root/" wp-tests-config.php sed -i "s/yourpasswordhere/root/" wp-tests-config.php + - name: Read WP core's required Node version + id: wp-node + run: echo "version=$(cat /tmp/wordpress/.nvmrc)" >> "$GITHUB_OUTPUT" + - name: Set up Node.js for WP core assets uses: actions/setup-node@v5 with: - node-version-file: /tmp/wordpress/.nvmrc + node-version: ${{ steps.wp-node.outputs.version }} - name: Building WP core assets # Core's dist JS/CSS isn't checked into git; missing it fails wp_head()'s