Skip to content

Commit 7c10de2

Browse files
committed
ci: update phpunit workflow to match wp-cli generated workflow
1 parent 2231d1f commit 7c10de2

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/test-php.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,31 @@ jobs:
2323
- name: Run PHPCS
2424
run: composer phpcs
2525
phpunit:
26-
name: Phpunit
26+
name: PHPUnit tests on ${{ matrix.php-versions }}
2727
runs-on: ubuntu-latest
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
2832
services:
29-
mysql:
30-
image: mysql:5.7
33+
database:
34+
image: mysql:latest
3135
env:
36+
MYSQL_DATABASE: wordpress_tests
3237
MYSQL_ROOT_PASSWORD: root
3338
ports:
34-
- 3306/tcp
35-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
39+
- 3306:3306
3640
steps:
3741
- name: Setup PHP version
3842
uses: shivammathur/setup-php@v2
3943
with:
40-
php-version: '8.0'
44+
php-version: ${{ matrix.php-version }}
4145
extensions: simplexml, mysql
42-
tools: phpunit-polyfills
46+
tools: phpunit-polyfills:1.1
4347
- name: Checkout source code
4448
uses: actions/checkout@v4
4549
- name: Install WordPress Test Suite
46-
run: |
47-
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:${{ job.services.mysql.ports['3306'] }}
50+
run: bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true
4851
- name: Install Composer dependencies
4952
run: composer install --prefer-dist --no-progress --no-suggest --no-dev
5053
- name: Run phpunit

0 commit comments

Comments
 (0)