diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 367ae8c4a5..07b8ddfce1 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,23 @@ 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: 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: ${{ 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 + # 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