From 3a624d84b8e890b4572fd0936451ff36c2d89edf Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Thu, 24 Jul 2025 16:55:00 -0400 Subject: [PATCH 01/17] Run a limited number of test combinations on forks --- .github/workflows/phpunit-tests.yml | 73 +++++++++++++++++++++++++++-- src/wp-activate.php | 1 + 2 files changed, 69 insertions(+), 5 deletions(-) diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index d266b40fb249b..bfe9aece52161 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -63,7 +63,7 @@ jobs: permissions: contents: read secrets: inherit - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} strategy: fail-fast: false matrix: @@ -140,7 +140,7 @@ jobs: permissions: contents: read secrets: inherit - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} strategy: fail-fast: false matrix: @@ -190,7 +190,7 @@ jobs: permissions: contents: read secrets: inherit - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} strategy: fail-fast: false matrix: @@ -235,7 +235,7 @@ jobs: permissions: contents: read secrets: inherit - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} strategy: fail-fast: false matrix: @@ -249,13 +249,76 @@ jobs: db-version: ${{ matrix.db-version }} phpunit-test-groups: ${{ matrix.phpunit-test-groups }} + limited-matrix-for-forks-mysql: + name: PHP ${{ matrix.php }} + uses: ./.github/workflows/reusable-phpunit-tests-v3.yml + permissions: + contents: read + secrets: inherit + if: ${{ github.repository != 'WordPress/wordpress-develop' && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }} + strategy: + fail-fast: false + matrix: + php: [ '7.2', '8.4' ] + db-version: [ '5.7', '8.4' ] + multisite: [ true, false ] + memcached: [ false ] + + include: + # Include jobs that test with memcached. + - php: '8.4' + db-version: '8.4' + memcached: true + # Run specific test groups once. + - php: '8.4' + db-version: '8.4' + memcached: false + phpunit-test-groups: 'html-api-html5lib-tests' + with: + php: ${{ matrix.php }} + db-version: ${{ matrix.db-version }} + memcached: ${{ matrix.memcached }} + phpunit-test-groups: ${{ matrix.phpunit-test-groups || '' }} + + limited-matrix-for-forks-mariadb: + name: PHP ${{ matrix.php }} + uses: ./.github/workflows/reusable-phpunit-tests-v3.yml + permissions: + contents: read + secrets: inherit + if: ${{ github.repository != 'WordPress/wordpress-develop' && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }} + strategy: + fail-fast: false + matrix: + php: [ '7.2', '8.4' ] + db-version: [ '5.5', '11.8' ] + multisite: [ true, false ] + memcached: [ false ] + + include: + # Include jobs that test with memcached. + - php: '8.4' + db-version: '11.8' + memcached: true + # Run specific test groups once. + - php: '8.4' + db-version: '11.8' + memcached: false + phpunit-test-groups: 'html-api-html5lib-tests' + with: + php: ${{ matrix.php }} + db-type: 'mariadb' + db-version: ${{ matrix.db-version }} + memcached: ${{ matrix.memcached }} + phpunit-test-groups: ${{ matrix.phpunit-test-groups || '' }} + slack-notifications: name: Slack Notifications uses: ./.github/workflows/slack-notifications.yml permissions: actions: read contents: read - needs: [ test-with-mysql, test-with-mariadb, test-innovation-releases, specific-test-groups ] + needs: [ test-with-mysql, test-with-mariadb, test-innovation-releases, specific-test-groups, limited-matrix-for-forks-mysql, limited-matrix-for-forks-mariadb ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} diff --git a/src/wp-activate.php b/src/wp-activate.php index f4fd8d76c31a7..2ba58ee76f131 100644 --- a/src/wp-activate.php +++ b/src/wp-activate.php @@ -23,6 +23,7 @@ list( $activate_path ) = explode( '?', wp_unslash( $_SERVER['REQUEST_URI'] ) ); $activate_cookie = 'wp-activate-' . COOKIEHASH; + $key = ''; $result = null; From 35e20e7b51ebafcf90cc72ee04212ab7e326654e Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 12:15:04 -0400 Subject: [PATCH 02/17] Pare down test combinations more. --- .github/workflows/phpunit-tests.yml | 58 ++++++++++------------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index bfe9aece52161..0392b95f9b5d3 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -249,7 +249,7 @@ jobs: db-version: ${{ matrix.db-version }} phpunit-test-groups: ${{ matrix.phpunit-test-groups }} - limited-matrix-for-forks-mysql: + limited-matrix-for-forks: name: PHP ${{ matrix.php }} uses: ./.github/workflows/reusable-phpunit-tests-v3.yml permissions: @@ -260,56 +260,36 @@ jobs: fail-fast: false matrix: php: [ '7.2', '8.4' ] - db-version: [ '5.7', '8.4' ] - multisite: [ true, false ] - memcached: [ false ] + db-version: [ '8.4', '11.8' ] + db-type: [ 'mysql', 'mariadb' ] + multisite: [ false ] include: - # Include jobs that test with memcached. + # Include one multisite job for each database type. - php: '8.4' db-version: '8.4' - memcached: true - # Run specific test groups once. - - php: '8.4' - db-version: '8.4' - memcached: false - phpunit-test-groups: 'html-api-html5lib-tests' - with: - php: ${{ matrix.php }} - db-version: ${{ matrix.db-version }} - memcached: ${{ matrix.memcached }} - phpunit-test-groups: ${{ matrix.phpunit-test-groups || '' }} - - limited-matrix-for-forks-mariadb: - name: PHP ${{ matrix.php }} - uses: ./.github/workflows/reusable-phpunit-tests-v3.yml - permissions: - contents: read - secrets: inherit - if: ${{ github.repository != 'WordPress/wordpress-develop' && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }} - strategy: - fail-fast: false - matrix: - php: [ '7.2', '8.4' ] - db-version: [ '5.5', '11.8' ] - multisite: [ true, false ] - memcached: [ false ] - - include: - # Include jobs that test with memcached. + db-type: 'mysql' + multisite: true - php: '8.4' db-version: '11.8' + db-type: 'mariadb' + multisite: true + # Test with memcached. + - php: '8.4' + db-version: '8.4' + db-type: 'mysql' + multisite: true memcached: true # Run specific test groups once. - php: '8.4' - db-version: '11.8' - memcached: false + db-version: '8.4' + db-type: 'mysql' phpunit-test-groups: 'html-api-html5lib-tests' with: php: ${{ matrix.php }} - db-type: 'mariadb' db-version: ${{ matrix.db-version }} - memcached: ${{ matrix.memcached }} + db-type: ${{ matrix.db-type }} + memcached: ${{ matrix.memcached || false }} phpunit-test-groups: ${{ matrix.phpunit-test-groups || '' }} slack-notifications: @@ -318,7 +298,7 @@ jobs: permissions: actions: read contents: read - needs: [ test-with-mysql, test-with-mariadb, test-innovation-releases, specific-test-groups, limited-matrix-for-forks-mysql, limited-matrix-for-forks-mariadb ] + needs: [ test-with-mysql, test-with-mariadb, test-innovation-releases, specific-test-groups, limited-matrix-for-forks ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} From e3e121d894b9f3de1c1b84239093cc09d667da31 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 12:21:10 -0400 Subject: [PATCH 03/17] Disable install testing on forks. --- .github/workflows/install-testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/install-testing.yml b/.github/workflows/install-testing.yml index 6d6caf246a347..a149f3205c255 100644 --- a/.github/workflows/install-testing.yml +++ b/.github/workflows/install-testing.yml @@ -47,7 +47,7 @@ jobs: permissions: contents: read secrets: inherit - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} with: wp-version: ${{ inputs.wp-version }} @@ -63,7 +63,7 @@ jobs: permissions: contents: read runs-on: ${{ matrix.os }} - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} timeout-minutes: 10 needs: [ build-test-matrix ] strategy: From 6682e5f2989478abc74c0b53b7ad9fcab619bcbc Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 12:21:52 -0400 Subject: [PATCH 04/17] Disable local environment testing on forks. --- .github/workflows/local-docker-environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/local-docker-environment.yml b/.github/workflows/local-docker-environment.yml index d8312015f621c..ada357bf2eb6a 100644 --- a/.github/workflows/local-docker-environment.yml +++ b/.github/workflows/local-docker-environment.yml @@ -73,7 +73,7 @@ jobs: permissions: contents: read secrets: inherit - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} with: wp-version: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }} From 1ae2b8fb3c9b285583d015940e85b6d2667321b6 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 12:23:09 -0400 Subject: [PATCH 05/17] Disable upgrade testing on forks. --- .github/workflows/upgrade-develop-testing.yml | 2 +- .github/workflows/upgrade-testing.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/upgrade-develop-testing.yml b/.github/workflows/upgrade-develop-testing.yml index b24fd5fea220d..2dc200b041c49 100644 --- a/.github/workflows/upgrade-develop-testing.yml +++ b/.github/workflows/upgrade-develop-testing.yml @@ -54,7 +54,7 @@ jobs: upgrade-tests-develop: name: Upgrade from ${{ matrix.wp }} uses: ./.github/workflows/reusable-upgrade-testing.yml - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} needs: [ build ] strategy: fail-fast: false diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml index 9694433b57a44..2fac7fdee192f 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/upgrade-testing.yml @@ -58,7 +58,7 @@ jobs: upgrade-tests-recent-releases: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} uses: ./.github/workflows/reusable-upgrade-testing.yml - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} strategy: fail-fast: false matrix: @@ -93,7 +93,7 @@ jobs: upgrade-tests-wp-6x-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} uses: ./.github/workflows/reusable-upgrade-testing.yml - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} strategy: fail-fast: false matrix: @@ -121,7 +121,7 @@ jobs: upgrade-tests-wp-5x-php-7x-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} uses: ./.github/workflows/reusable-upgrade-testing.yml - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} strategy: fail-fast: false matrix: @@ -153,7 +153,7 @@ jobs: upgrade-tests-wp-5x-php-8x-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} uses: ./.github/workflows/reusable-upgrade-testing.yml - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} strategy: fail-fast: false matrix: @@ -181,7 +181,7 @@ jobs: upgrade-tests-oldest-wp-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} uses: ./.github/workflows/reusable-upgrade-testing.yml - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} strategy: fail-fast: false matrix: From 65bd314436ff8da86c2accfa8b9a4032bae10ef3 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 12:23:59 -0400 Subject: [PATCH 06/17] Don't confirm Gutenberg build process in forks. --- .github/workflows/test-build-processes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index 966a458550dc3..f02c226b32de3 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -99,7 +99,7 @@ jobs: uses: ./.github/workflows/reusable-test-gutenberg-build-process.yml permissions: contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} strategy: fail-fast: false matrix: From 5ec2f07ac3e8b02916851226fd5b730ffc33f15a Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 12:24:45 -0400 Subject: [PATCH 07/17] Don't create and upload theme Zip files on forks. --- .github/workflows/test-and-zip-default-themes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-zip-default-themes.yml b/.github/workflows/test-and-zip-default-themes.yml index 49b7522cfe1a7..56cc2e9895cd2 100644 --- a/.github/workflows/test-and-zip-default-themes.yml +++ b/.github/workflows/test-and-zip-default-themes.yml @@ -189,7 +189,7 @@ jobs: contents: read needs: [ check-for-empty-files, test-build-scripts ] timeout-minutes: 10 - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + if: ${{ github.repository == 'WordPress/wordpress-develop' }} strategy: fail-fast: false matrix: From 1c5149b82aa2d63aabaa0727141bd356cabddecb Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 12:30:43 -0400 Subject: [PATCH 08/17] Exclude non-existent combinations. --- .github/workflows/phpunit-tests.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 0392b95f9b5d3..118fe6614d608 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -285,6 +285,14 @@ jobs: db-version: '8.4' db-type: 'mysql' phpunit-test-groups: 'html-api-html5lib-tests' + + exclude: + # Exclude PHP versions that are not supported by the database versions. + - db-type: 'mysql' + db-version: '11.8' + - db-type: 'mariadb' + db-version: '8.4' + with: php: ${{ matrix.php }} db-version: ${{ matrix.db-version }} From e08b9bdd41e047b63ec92786dbb3ae1d12e9b437 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 12:32:39 -0400 Subject: [PATCH 09/17] Exclude memcache jobs in forks. --- .github/workflows/performance.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index b9ef6af19f8c2..9cd88204c8512 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -92,6 +92,7 @@ jobs: performance: name: ${{ matrix.multisite && 'Multisite' || 'Single Site' }} ${{ matrix.memcached && 'Memcached' || 'Default' }} uses: ./.github/workflows/reusable-performance-test-v2.yml + if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && ! matrix.memcached ) }} needs: [ determine-matrix ] permissions: contents: read From 228e58513253f1e31311521454db8e738a3b597a Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 12:38:05 -0400 Subject: [PATCH 10/17] The `matrix` context is not available within `if` --- .github/workflows/performance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 9cd88204c8512..e8b4e773aa67a 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -92,7 +92,7 @@ jobs: performance: name: ${{ matrix.multisite && 'Multisite' || 'Single Site' }} ${{ matrix.memcached && 'Memcached' || 'Default' }} uses: ./.github/workflows/reusable-performance-test-v2.yml - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && ! matrix.memcached ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} needs: [ determine-matrix ] permissions: contents: read From ad6613dac4676260cac4c92e40d6f2098979c802 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 13:08:50 -0400 Subject: [PATCH 11/17] Add a limited number of upgrade tests. --- .github/workflows/upgrade-develop-testing.yml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/upgrade-develop-testing.yml b/.github/workflows/upgrade-develop-testing.yml index 2dc200b041c49..f6ccff089dd4c 100644 --- a/.github/workflows/upgrade-develop-testing.yml +++ b/.github/workflows/upgrade-develop-testing.yml @@ -83,6 +83,36 @@ jobs: new-version: develop multisite: ${{ matrix.multisite }} + # Run a limited set of upgrade tests for the current branch on forks. + upgrade-tests-develop-forks: + name: Upgrade from ${{ matrix.wp }} + uses: ./.github/workflows/reusable-upgrade-testing.yml + if: ${{ github.repository == 'WordPress/wordpress-develop' }} + needs: [ build ] + strategy: + fail-fast: false + matrix: + os: [ 'ubuntu-24.04' ] + php: [ '7.2', '8.4' ] + db-type: [ 'mysql' ] + db-version: [ '8.4' ] + # WordPress 4.9 is the oldest version that supports PHP 7.2. + wp: [ '6.7', '6.8' ] + multisite: [ false, true ] + + exclude: + # The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218. + - php: '7.2' + db-version: '8.4' + with: + os: ${{ matrix.os }} + php: ${{ matrix.php }} + db-type: ${{ matrix.db-type }} + db-version: ${{ matrix.db-version }} + wp: ${{ matrix.wp }} + new-version: develop + multisite: ${{ matrix.multisite }} + slack-notifications: name: Slack Notifications uses: ./.github/workflows/slack-notifications.yml From e9a58db954e0eb1fcf3112e5acc66c03c9dc772f Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 13:12:36 -0400 Subject: [PATCH 12/17] Remove new condition for performance workflow. --- .github/workflows/performance.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index e8b4e773aa67a..b9ef6af19f8c2 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -92,7 +92,6 @@ jobs: performance: name: ${{ matrix.multisite && 'Multisite' || 'Single Site' }} ${{ matrix.memcached && 'Memcached' || 'Default' }} uses: ./.github/workflows/reusable-performance-test-v2.yml - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} needs: [ determine-matrix ] permissions: contents: read From b01cd498f319a49eacd3e0a22547e3aa177072a7 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 13:19:54 -0400 Subject: [PATCH 13/17] Add some inline docs. --- .github/workflows/phpunit-tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 118fe6614d608..3e4c68519b8fb 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -249,6 +249,13 @@ jobs: db-version: ${{ matrix.db-version }} phpunit-test-groups: ${{ matrix.phpunit-test-groups }} + # + # Runs unit tests for forks. + # + # Because the majority of forks will belong to personal GitHub accounts (which are limited to just 20 concurrent jobs + # at any given time), forks only run a small subset of test combinations. This allows contributors to open pull + # requests back to their own forks for testing purposes without having to wait hours for workflow to complete. + # limited-matrix-for-forks: name: PHP ${{ matrix.php }} uses: ./.github/workflows/reusable-phpunit-tests-v3.yml From 4439ce854fed6dc602293a4e95af42a9752441fe Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 14:13:07 -0400 Subject: [PATCH 14/17] Adjust conditions for upgrade develop testing. --- .github/workflows/upgrade-develop-testing.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upgrade-develop-testing.yml b/.github/workflows/upgrade-develop-testing.yml index f6ccff089dd4c..f5e61ae7ad572 100644 --- a/.github/workflows/upgrade-develop-testing.yml +++ b/.github/workflows/upgrade-develop-testing.yml @@ -47,6 +47,7 @@ jobs: build: name: Build uses: ./.github/workflows/reusable-build-package.yml + if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event == 'pull_request' && github.actor != 'dependabot[bot]' ) }} permissions: contents: read @@ -87,7 +88,7 @@ jobs: upgrade-tests-develop-forks: name: Upgrade from ${{ matrix.wp }} uses: ./.github/workflows/reusable-upgrade-testing.yml - if: ${{ github.repository == 'WordPress/wordpress-develop' }} + if: ${{ github.repository != 'WordPress/wordpress-develop' }} needs: [ build ] strategy: fail-fast: false From 7f9f932f909e6f518d0779b43b477a09f4c27d52 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 14:13:51 -0400 Subject: [PATCH 15/17] Fix typo in context value. --- .github/workflows/upgrade-develop-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upgrade-develop-testing.yml b/.github/workflows/upgrade-develop-testing.yml index f5e61ae7ad572..2cab18e2be200 100644 --- a/.github/workflows/upgrade-develop-testing.yml +++ b/.github/workflows/upgrade-develop-testing.yml @@ -47,7 +47,7 @@ jobs: build: name: Build uses: ./.github/workflows/reusable-build-package.yml - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} permissions: contents: read From 6cdc7f7987b444519f7a7c0f0e1c10d5d1432129 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jul 2025 15:45:38 -0400 Subject: [PATCH 16/17] Avoid testing the build process on Windows in forks --- .github/workflows/test-build-processes.yml | 33 ++++++++++------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index f02c226b32de3..dc0b233c60c2b 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -55,30 +55,28 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-24.04, windows-2022 ] directory: [ 'src', 'build' ] include: # Only prepare artifacts for Playground once. - - os: ubuntu-24.04 - directory: 'build' + - directory: 'build' save-build: true prepare-playground: ${{ github.event_name == 'pull_request' && true || '' }} - with: - os: ${{ matrix.os }} + os: 'ubuntu-24.04' directory: ${{ matrix.directory }} save-build: ${{ matrix.save-build && matrix.save-build || false }} prepare-playground: ${{ matrix.prepare-playground && matrix.prepare-playground || false }} - # Tests the WordPress Core build process on MacOS. + # Tests the WordPress Core build process on additional operating systems. # - # This is separate from the job above in order to use stricter conditions when determining when to run. - # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate. + # This is separate from the job above in order to use stricter conditions when determining when to test additional + # operating systems. This avoids unintentionally consuming excessive minutes, as Windows-based jobs consume minutes at + # a 2x rate, and MacOS-based jobs at a 10x rate. # # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is # currently no way to determine the OS being used on a given job. # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. - test-core-build-process-macos: + test-core-build-process-extended: name: Core running from ${{ matrix.directory }} uses: ./.github/workflows/reusable-test-core-build-process.yml permissions: @@ -87,7 +85,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ macos-14 ] + os: [ 'macos-14', 'windows-2022' ] directory: [ 'src', 'build' ] with: os: ${{ matrix.os }} @@ -103,21 +101,20 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-24.04, windows-2022 ] directory: [ 'src', 'build' ] with: - os: ${{ matrix.os }} directory: ${{ matrix.directory }} - # Tests the Gutenberg plugin build process on MacOS when run within a wordpress-develop checkout. + # Tests the Gutenberg plugin build process on additional operating systems. # - # This is separate from the job above in order to use stricter conditions when determining when to run. - # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate. + # This is separate from the job above in order to use stricter conditions when determining when to test additional + # operating systems. This avoids unintentionally consuming excessive minutes, as Windows-based jobs consume minutes at + # a 2x rate, and MacOS-based jobs at a 10x rate. # # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is # currently no way to determine the OS being used on a given job. # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. - test-gutenberg-build-process-macos: + test-gutenberg-build-process-extended: name: Gutenberg running from ${{ matrix.directory }} uses: ./.github/workflows/reusable-test-gutenberg-build-process.yml permissions: @@ -126,7 +123,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ macos-14 ] + os: [ 'macos-14', 'windows-2022' ] directory: [ 'src', 'build' ] with: os: ${{ matrix.os }} @@ -138,7 +135,7 @@ jobs: permissions: actions: read contents: read - needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] + needs: [ test-core-build-process, test-core-build-process-extended, test-gutenberg-build-process, test-gutenberg-build-process-extended ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} From 9f378b1b242f759cce4daae27058b771ea7c690a Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 1 Aug 2025 07:34:39 -0400 Subject: [PATCH 17/17] Run the full test suite on organization forks. --- .github/workflows/phpunit-tests.yml | 10 +++---- .github/workflows/test-build-processes.yml | 28 +++++++++++-------- .github/workflows/upgrade-develop-testing.yml | 2 +- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 3e4c68519b8fb..81a5f159b5981 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -63,7 +63,7 @@ jobs: permissions: contents: read secrets: inherit - if: ${{ github.repository == 'WordPress/wordpress-develop' }} + if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) ) }} strategy: fail-fast: false matrix: @@ -140,7 +140,7 @@ jobs: permissions: contents: read secrets: inherit - if: ${{ github.repository == 'WordPress/wordpress-develop' }} + if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) ) }} strategy: fail-fast: false matrix: @@ -190,7 +190,7 @@ jobs: permissions: contents: read secrets: inherit - if: ${{ github.repository == 'WordPress/wordpress-develop' }} + if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) ) }} strategy: fail-fast: false matrix: @@ -235,7 +235,7 @@ jobs: permissions: contents: read secrets: inherit - if: ${{ github.repository == 'WordPress/wordpress-develop' }} + if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) ) }} strategy: fail-fast: false matrix: @@ -262,7 +262,7 @@ jobs: permissions: contents: read secrets: inherit - if: ${{ github.repository != 'WordPress/wordpress-develop' && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }} + if: ${{ ! startsWith( github.repository, 'WordPress/' ) && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index dc0b233c60c2b..559dd0a92a1c4 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -45,7 +45,7 @@ concurrency: permissions: {} jobs: - # Tests the WordPress Core build process on multiple operating systems. + # Tests the WordPress Core build process. test-core-build-process: name: Core running from ${{ matrix.directory }} uses: ./.github/workflows/reusable-test-core-build-process.yml @@ -55,14 +55,16 @@ jobs: strategy: fail-fast: false matrix: + os: [ 'ubuntu-24.04' ] directory: [ 'src', 'build' ] include: # Only prepare artifacts for Playground once. - - directory: 'build' + - os: 'ubuntu-24.04' + directory: 'build' save-build: true prepare-playground: ${{ github.event_name == 'pull_request' && true || '' }} with: - os: 'ubuntu-24.04' + os: ${{ matrix.os }} directory: ${{ matrix.directory }} save-build: ${{ matrix.save-build && matrix.save-build || false }} prepare-playground: ${{ matrix.prepare-playground && matrix.prepare-playground || false }} @@ -70,13 +72,14 @@ jobs: # Tests the WordPress Core build process on additional operating systems. # # This is separate from the job above in order to use stricter conditions when determining when to test additional - # operating systems. This avoids unintentionally consuming excessive minutes, as Windows-based jobs consume minutes at - # a 2x rate, and MacOS-based jobs at a 10x rate. + # operating systems. This avoids unintentionally consuming excessive minutes. Windows-based jobs consume minutes at a + # 2x rate, and MacOS-based jobs at a 10x rate. + # See https://docs.github.com/en/billing/concepts/product-billing/github-actions#per-minute-rates. # # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is # currently no way to determine the OS being used on a given job. # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. - test-core-build-process-extended: + test-core-build-process-additional-os: name: Core running from ${{ matrix.directory }} uses: ./.github/workflows/reusable-test-core-build-process.yml permissions: @@ -91,7 +94,7 @@ jobs: os: ${{ matrix.os }} directory: ${{ matrix.directory }} - # Tests the Gutenberg plugin build process on multiple operating systems when run within a wordpress-develop checkout. + # Tests the Gutenberg plugin build process within a wordpress-develop checkout. test-gutenberg-build-process: name: Gutenberg running from ${{ matrix.directory }} uses: ./.github/workflows/reusable-test-gutenberg-build-process.yml @@ -101,20 +104,23 @@ jobs: strategy: fail-fast: false matrix: + os: [ 'ubuntu-24.04' ] directory: [ 'src', 'build' ] with: + os: ${{ matrix.os }} directory: ${{ matrix.directory }} # Tests the Gutenberg plugin build process on additional operating systems. # # This is separate from the job above in order to use stricter conditions when determining when to test additional - # operating systems. This avoids unintentionally consuming excessive minutes, as Windows-based jobs consume minutes at - # a 2x rate, and MacOS-based jobs at a 10x rate. + # operating systems. This avoids unintentionally consuming excessive minutes. Windows-based jobs consume minutes at a + # 2x rate, and MacOS-based jobs at a 10x rate. + # See https://docs.github.com/en/billing/concepts/product-billing/github-actions#per-minute-rates. # # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is # currently no way to determine the OS being used on a given job. # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. - test-gutenberg-build-process-extended: + test-gutenberg-build-process-additional-os: name: Gutenberg running from ${{ matrix.directory }} uses: ./.github/workflows/reusable-test-gutenberg-build-process.yml permissions: @@ -135,7 +141,7 @@ jobs: permissions: actions: read contents: read - needs: [ test-core-build-process, test-core-build-process-extended, test-gutenberg-build-process, test-gutenberg-build-process-extended ] + needs: [ test-core-build-process, test-core-build-process-additional-os, test-gutenberg-build-process, test-gutenberg-build-process-additional-os ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} diff --git a/.github/workflows/upgrade-develop-testing.yml b/.github/workflows/upgrade-develop-testing.yml index 2cab18e2be200..ad5211f271f4d 100644 --- a/.github/workflows/upgrade-develop-testing.yml +++ b/.github/workflows/upgrade-develop-testing.yml @@ -47,7 +47,7 @@ jobs: build: name: Build uses: ./.github/workflows/reusable-build-package.yml - if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }} + if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) ) }} permissions: contents: read