Skip to content

Commit 32801f0

Browse files
committed
Test PHPUnit against a matrix of supported PHP versions.
1 parent 23559ed commit 32801f0

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

‎.github/workflows/unit-test.yml‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,24 @@ jobs:
5555
run: npm run test-unit:date -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
5656

5757
unit-php:
58-
name: PHP
58+
name: PHP ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }} on 'ubuntu-24.04'
5959
runs-on: 'ubuntu-24.04'
6060
timeout-minutes: 20
6161
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
6262

63+
strategy:
64+
fail-fast: true
65+
matrix:
66+
php:
67+
- '5.6'
68+
- '7.0'
69+
- '7.4'
70+
- '8.0'
71+
multisite: [false, true]
72+
73+
env:
74+
WP_ENV_PHP_VERSION: ${{ matrix.php }}
75+
6376
steps:
6477
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6578

@@ -88,9 +101,9 @@ jobs:
88101
run: npm run lint-php
89102

90103
- name: Running single site unit tests
104+
if: ${{ ! matrix.multisite }}
91105
run: npm run test-unit-php
92-
if: ${{ success() || failure() }}
93106

94107
- name: Running multisite unit tests
108+
if: ${{ matrix.multisite }}
95109
run: npm run test-unit-php-multisite
96-
if: ${{ success() || failure() }}

0 commit comments

Comments
 (0)