diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 367ae8c4a5..af1857e0b6 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -22,6 +22,10 @@ jobs: env: WP_MULTISITE: ${{ matrix.multisite }} strategy: + # Report every matrix leg's own result rather than the default fail-fast + # cancelling the others as soon as one fails - same reasoning as cypress.yml's + # `fail-fast: false`. + fail-fast: false matrix: include: - php: 7.4 @@ -30,6 +34,9 @@ jobs: - php: 8.0 wordpress: 6.9 multisite: 0 + - php: 8.0 + wordpress: trunk + multisite: 0 name: PHP ${{ matrix.php }} tests in WP ${{ matrix.wordpress }} steps: @@ -53,6 +60,33 @@ 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 + + # A release branch (e.g. 6.9) ships pre-built dist/minified assets under `src/`; + # a raw `trunk` checkout doesn't, so it hits unrelated core code paths that + # expect them to already exist (wp_maybe_inline_styles's dist stylesheet check, + # wp-admin CSS minification for e.g. view-transitions.min.css). Build them the + # same way core's own CI does (reusable-build-package.yml: npm ci && npm run + # build), but with the `:dev` variant so the output lands in `src/` (Gruntfile's + # WORKING_DIR under `--dev`) where WP_DEVELOP_DIR points, instead of the plain + # build's separate `build/` package directory. + # + # Node version comes from the WP core checkout's own `.nvmrc`, not this + # runner's default - core's `engines.node` requirement moves with trunk and the + # runner default (Node 22 as of this writing) already trails it (WordPress#7.2.0 + # requires >=24.18.0). + - name: Set up Node for WP core's build (trunk only) + if: matrix.wordpress == 'trunk' + uses: actions/setup-node@v4 + with: + node-version-file: /tmp/wordpress/.nvmrc + + - name: Build WP core assets (trunk only - release branches ship these pre-built) + if: matrix.wordpress == 'trunk' + timeout-minutes: 5 + run: | + cd /tmp/wordpress + npm ci + npm run build:dev - name: Creating database run: | sudo /etc/init.d/mysql start diff --git a/tests/phpunit/styles/test_FrmStylesController.php b/tests/phpunit/styles/test_FrmStylesController.php index d4061d4bdb..e5697569a0 100644 --- a/tests/phpunit/styles/test_FrmStylesController.php +++ b/tests/phpunit/styles/test_FrmStylesController.php @@ -22,6 +22,15 @@ public function test_front_head() { ob_start(); wp_head(); $styles = ob_get_clean(); + + // wp_maybe_inline_styles() (WP core, unrelated to anything Formidable enqueues) + // flags a core stylesheet's dist asset as unreadable whenever this environment's + // WP checkout doesn't have its built dist/ files on disk - a property of the + // checkout, not the WP version under test, so a released-branch job may never + // see it while an unbuilt trunk checkout always does. Discard it either way + // rather than requiring it to fire. + unset( $this->caught_doing_it_wrong['wp_maybe_inline_styles'] ); + $this->assertNotEmpty( $styles ); $frm_settings = FrmAppHelper::get_settings();