-
Notifications
You must be signed in to change notification settings - Fork 14
67 lines (63 loc) · 1.7 KB
/
Copy pathwp-phpunit.yml
File metadata and controls
67 lines (63 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Unit Testing
on:
push:
branches:
- trunk
paths:
- '**/*.php'
- 'composer.json'
- 'composer.lock'
- 'phpunit.xml.dist'
- 'phpcs.xml'
- '.github/workflows/wp-phpunit.yml'
pull_request:
paths:
- '**/*.php'
- 'composer.json'
- 'composer.lock'
- 'phpunit.xml.dist'
- 'phpcs.xml'
- '.github/workflows/wp-phpunit.yml'
jobs:
phpunit:
runs-on: ubuntu-latest
services:
mysql:
image: mariadb:10.4
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '8.3', '8.5']
wp-version: ['latest']
include:
- wp-version: '6.5'
php-versions: '7.2'
- wp-version: trunk
php-versions: '8.5'
steps:
- name: Install svn
run: |
sudo apt-get update
sudo apt-get install subversion
- name: Checkout
uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
tools: composer, phpunit-polyfills
extensions: mysql
- name: Install Composer dependencies for PHP
uses: ramsey/composer-install@v4
- name: Setup Test Environment
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 ${{ matrix.wp-version }}
- name: Unit Testing
run: ./vendor/bin/phpunit
env:
PHP_VERSION: ${{ matrix.php-versions }}