-
Notifications
You must be signed in to change notification settings - Fork 7
89 lines (77 loc) · 2.79 KB
/
testing.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Run plugin tests
on: [pull_request]
jobs:
test:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0']
wordpress-versions: ['5.3.0', 'latest']
phpunit-versions: ['7.5.20', '9.5.26']
exclude:
- operating-system: ubuntu-latest
php-versions: '8.0'
wordpress-versions: '5.3.0'
phpunit-versions: '7.5.20'
- operating-system: ubuntu-latest
php-versions: '8.0'
wordpress-versions: '5.3.0'
phpunit-versions: '9.5.26'
- operating-system: ubuntu-latest
php-versions: '7.4'
wordpress-versions: '5.3.0'
phpunit-versions: '9.5.26'
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
name: PHP ${{ matrix.php-versions }} with ${{ matrix.wordpress-versions }}
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, intl, mysql, mysqli
ini-values-csv: post_max_size=256M, short_open_tag=On
coverage: xdebug
pecl: false
tools: phpunit:${{ matrix.phpunit-versions }}
- name: Install WP Tests
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:${{ job.services.mysql.ports['3306'] }} ${{ matrix.wordpress-versions }} true
- name: Run phpunit tests
run: phpunit
- name: Run phpunit tests against multisite install
run: WP_MULTISITE=1 phpunit
phpcs:
runs-on: ubuntu-latest
name: Check WP Coding Standards
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: '8.0'
extension-csv: mbstring, intl
ini-values-csv: post_max_size=256M, short_open_tag=On
coverage: none
pecl: false
tools: phpcs
- name: Setup PHPCS for WordPress
run: |
composer global require phpcompatibility/php-compatibility
composer global require phpcompatibility/phpcompatibility-paragonie
composer global require phpcompatibility/phpcompatibility-wp
composer global require wp-coding-standards/wpcs
composer global require automattic/vipwpcs
composer global require dealerdirect/phpcodesniffer-composer-installer
- name: Run PHPCS on the plugin
run: phpcs