|
1 | 1 | name: PHPUnit Tests |
| 2 | +run-name: PHPUnit Tests${{ ( github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'Full PHPUnit Matrix' ) ) ) && ' (full matrix)' || '' }} |
2 | 3 |
|
3 | 4 | on: |
4 | 5 | push: |
|
11 | 12 | - trunk |
12 | 13 | - '3.[7-9]' |
13 | 14 | - '[4-9].[0-9]' |
| 15 | + # Keep these paths in sync with phpunit-tests-full-matrix.yml. |
14 | 16 | paths: |
15 | 17 | # Any change to a PHP, CSS, JavaScript, JSON, HTML, or otherwise tested file should run checks. |
16 | 18 | - '**.css' |
|
33 | 35 | - 'phpunit.xml.dist' |
34 | 36 | # Confirm any changes to relevant workflow files. |
35 | 37 | - '.github/workflows/phpunit-tests.yml' |
| 38 | + - '.github/workflows/phpunit-tests-full-matrix.yml' |
36 | 39 | - '.github/workflows/reusable-phpunit-tests-*.yml' |
37 | 40 | workflow_dispatch: |
| 41 | + workflow_call: |
| 42 | + secrets: |
| 43 | + CODEVITALS_PROJECT_TOKEN: |
| 44 | + required: false |
| 45 | + CODECOV_TOKEN: |
| 46 | + required: false |
| 47 | + WPT_REPORT_API_KEY: |
| 48 | + required: false |
| 49 | + SLACK_GHA_SUCCESS_WEBHOOK: |
| 50 | + required: false |
| 51 | + SLACK_GHA_CANCELLED_WEBHOOK: |
| 52 | + required: false |
| 53 | + SLACK_GHA_FIXED_WEBHOOK: |
| 54 | + required: false |
| 55 | + SLACK_GHA_FAILURE_WEBHOOK: |
| 56 | + required: false |
38 | 57 | # Once weekly On Sundays at 00:00 UTC. |
39 | 58 | schedule: |
40 | 59 | - cron: '0 0 * * 0' |
@@ -78,13 +97,27 @@ jobs: |
78 | 97 | fail-fast: false |
79 | 98 | matrix: |
80 | 99 | os: [ ubuntu-24.04 ] |
81 | | - # Test highest and lowest supported version of each major. |
82 | | - php: [ '7.4', '8.0', '8.5' ] |
| 100 | + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] |
83 | 101 | db-type: [ 'mysql' ] |
84 | 102 | db-version: [ '5.7', '8.0', '8.4' ] |
85 | 103 | tests-domain: [ 'example.org' ] |
86 | 104 | multisite: [ false, true ] |
87 | 105 | memcached: [ false ] |
| 106 | + # Dispatched runs and pull requests labeled 'Full PHPUnit Matrix' test every version above. |
| 107 | + # Other runs retain boundary PHP versions and the routine database versions below. |
| 108 | + full-matrix: |
| 109 | + - ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'Full PHPUnit Matrix' ) ) }} |
| 110 | + |
| 111 | + exclude: |
| 112 | + # Outside the full matrix, test the highest and lowest PHP version of each major. |
| 113 | + - full-matrix: false |
| 114 | + php: '8.1' |
| 115 | + - full-matrix: false |
| 116 | + php: '8.2' |
| 117 | + - full-matrix: false |
| 118 | + php: '8.3' |
| 119 | + - full-matrix: false |
| 120 | + php: '8.4' |
88 | 121 |
|
89 | 122 | include: |
90 | 123 | # Include jobs that test with memcached. |
@@ -159,12 +192,31 @@ jobs: |
159 | 192 | fail-fast: false |
160 | 193 | matrix: |
161 | 194 | os: [ ubuntu-24.04 ] |
162 | | - # Test highest and lowest supported version of each major. |
163 | | - php: [ '7.4', '8.0', '8.5' ] |
| 195 | + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] |
164 | 196 | db-type: [ 'mariadb' ] |
165 | 197 | db-version: [ '5.5', '10.3', '10.5', '10.6', '10.11', '11.4', '11.8' ] |
166 | 198 | multisite: [ false, true ] |
167 | 199 | memcached: [ false ] |
| 200 | + # Dispatched runs and pull requests labeled 'Full PHPUnit Matrix' test every version above. |
| 201 | + # Other runs retain boundary PHP versions and the routine database versions below. |
| 202 | + full-matrix: |
| 203 | + - ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'Full PHPUnit Matrix' ) ) }} |
| 204 | + |
| 205 | + exclude: |
| 206 | + # Outside the full matrix, test the highest and lowest PHP version of each major. |
| 207 | + - full-matrix: false |
| 208 | + php: '8.1' |
| 209 | + - full-matrix: false |
| 210 | + php: '8.2' |
| 211 | + - full-matrix: false |
| 212 | + php: '8.3' |
| 213 | + - full-matrix: false |
| 214 | + php: '8.4' |
| 215 | + # Keep these database versions in full runs only. |
| 216 | + - full-matrix: false |
| 217 | + db-version: '10.3' |
| 218 | + - full-matrix: false |
| 219 | + db-version: '10.5' |
168 | 220 |
|
169 | 221 | include: |
170 | 222 | # Include jobs that test with memcached. |
@@ -215,15 +267,27 @@ jobs: |
215 | 267 | fail-fast: false |
216 | 268 | matrix: |
217 | 269 | os: [ ubuntu-24.04 ] |
218 | | - # Test highest and lowest supported version of each major. |
219 | | - php: [ '7.4', '8.0', '8.5' ] |
| 270 | + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] |
220 | 271 | db-type: [ 'mysql', 'mariadb' ] |
221 | 272 | db-version: [ '9.6', '12.1' ] |
222 | 273 | multisite: [ false, true ] |
223 | 274 | memcached: [ false ] |
224 | 275 | db-innovation: [ true ] |
| 276 | + # Dispatched runs and pull requests labeled 'Full PHPUnit Matrix' test every version above. |
| 277 | + # Other runs retain boundary PHP versions and the routine database versions below. |
| 278 | + full-matrix: |
| 279 | + - ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'Full PHPUnit Matrix' ) ) }} |
225 | 280 |
|
226 | 281 | exclude: |
| 282 | + # Outside the full matrix, test the highest and lowest PHP version of each major. |
| 283 | + - full-matrix: false |
| 284 | + php: '8.1' |
| 285 | + - full-matrix: false |
| 286 | + php: '8.2' |
| 287 | + - full-matrix: false |
| 288 | + php: '8.3' |
| 289 | + - full-matrix: false |
| 290 | + php: '8.4' |
227 | 291 | # Exclude version combinations that don't exist. |
228 | 292 | - db-type: 'mariadb' |
229 | 293 | db-version: '9.6' |
|
0 commit comments