Skip to content

Commit 3ee11ca

Browse files
authored
Merge pull request #63 from Automattic/update/tests-workflow-forwp-php
Run the unit tests for the lowest and latest versions of WordPress/PHP, bump minimum WordPress to 6.0
2 parents 34e5bf4 + 8f6e2a3 commit 3ee11ca

File tree

16 files changed

+883
-313
lines changed

16 files changed

+883
-313
lines changed

.github/workflows/phpunit.yml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,47 @@ concurrency:
77
cancel-in-progress: true
88

99
jobs:
10-
build:
10+
test:
11+
# Alias 'master' to 'latest'
12+
name: WP ${{ matrix.wp == 'master' && 'latest' || matrix.wp }} and PHP ${{ matrix.php }}
1113
runs-on: ubuntu-latest
14+
continue-on-error: ${{ matrix.allowed_failure }}
1215

1316
strategy:
17+
fail-fast: false
1418
matrix:
15-
php-versions:
16-
- 8.0
17-
18-
env:
19-
DB_DATABASE: test_db
20-
DB_USER: root
21-
DB_PASSWORD: root
19+
include:
20+
# Check lowest supported WP version, with the lowest supported PHP.
21+
- php: "8.0"
22+
wp: "6.0"
23+
allowed_failure: false
24+
# Check latest WP with the highest supported PHP.
25+
- php: "latest"
26+
wp: "master"
27+
allowed_failure: false
2228

2329
steps:
24-
- name: Checkout
25-
uses: actions/checkout@v2
30+
- name: Checkout code
31+
uses: actions/checkout@v4
2632

2733
- name: Install wordpress environment
2834
run: npm -g install @wordpress/env
2935

30-
- name: Setup PHP
36+
- name: Setup PHP ${{ matrix.php }}
3137
uses: shivammathur/setup-php@v2
3238
with:
39+
php-version: ${{ matrix.php }}
3340
tools: composer
34-
php-version: ${{ matrix.php-versions }}
35-
36-
- name: Setup MySQL
37-
run: |
38-
sudo /etc/init.d/mysql start
3941

40-
- name: Cache Composer packages
41-
id: composer-cache
42-
uses: actions/cache@v2
42+
- name: Install Composer dependencies
43+
uses: ramsey/composer-install@v3
4344
with:
44-
path: vendor
45-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
46-
restore-keys: |
47-
${{ runner.os }}-php-
48-
49-
- name: Install dependencies
50-
run: composer install --prefer-dist --no-progress
45+
composer-options: --prefer-dist --no-progress
5146

52-
- name: Setup the wordpress environment
47+
- name: Setup wp-env
5348
run: wp-env start
49+
env:
50+
WP_ENV_CORE: WordPress/WordPress#${{ matrix.wp }}
5451

5552
- name: PHPUnit
5653
run: composer test

composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
"dealerdirect/phpcodesniffer-composer-installer": true,
3333
"mnsami/composer-custom-directory-installer": false
3434
},
35-
"platform": {
36-
"php": "8.0.2"
37-
},
3835
"sort-packages": true
3936
}
4037
}

0 commit comments

Comments
 (0)