-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 1.85 KB
/
Copy pathphpunit.yml
File metadata and controls
69 lines (57 loc) · 1.85 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
68
69
name: PHPUnit Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
phpunit:
name: PHPUnit (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.3']
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_ALLOW_EMPTY_PASSWORD: 1
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, pdo_mysql
coverage: none
tools: composer
- name: Install dependencies
run: composer install --prefer-dist --no-progress --ignore-platform-reqs
- name: Install Subversion
run: sudo apt-get update && sudo apt-get install -y subversion
- name: Setup WordPress test environment
env:
WP_VERSION: latest
WP_TESTS_DIR: /tmp/wordpress-tests-lib
WP_CORE_DIR: /tmp/wordpress
run: |
# Install WordPress test suite with PHP-version-specific database name
bash bin/install-wp-tests.sh wordpress_test_${{ matrix.php }} root root 127.0.0.1:3306 $WP_VERSION
- name: Run PHPUnit tests
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib
run: composer test
- name: Run Unit tests only
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib
run: composer test:unit
- name: Run Integration tests only
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib
run: composer test:integration