Skip to content

Commit e91ebec

Browse files
authored
Workflows: Prime a WP install and skip install for the actual test run. (#256)
The PHPUnit test workflow now performs a dummy run to prime the WordPress install for tests. When this completes, the actual test run is performed, with the `WP_TESTS_SKIP_INSTALL` environment variable set to `1`. Since many of the tests must run in separate processes, this change means that installation occurs only once, instead of once per process.
1 parent 3206ff0 commit e91ebec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/phpunit-tests.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,10 @@ jobs:
4141
- name: Setup tests
4242
run: bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true
4343

44+
- name: Prime the WordPress install for tests
45+
id: prime-tests
46+
run: XDEBUG_MODE=off phpunit${{ matrix.multisite && ' -c tests/phpunit/multisite.xml' || '' }} --filter gha_install_wp > /dev/null 2>&1
47+
4448
- name: Run tests
45-
run: XDEBUG_MODE=off phpunit${{ matrix.multisite && ' -c tests/phpunit/multisite.xml' || '' }}
49+
if: steps.prime-tests.outcome == 'success'
50+
run: XDEBUG_MODE=off WP_TESTS_SKIP_INSTALL=1 phpunit${{ matrix.multisite && ' -c tests/phpunit/multisite.xml' || '' }}

0 commit comments

Comments
 (0)