-
Notifications
You must be signed in to change notification settings - Fork 132
66 lines (54 loc) · 2.16 KB
/
php-tests.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
name: PHP Tests
on: push
jobs:
test:
name: WP ${{ matrix.wp }} and PHP ${{ matrix.php }}
# Ubuntu-20.x includes MySQL 8.0, which causes `caching_sha2_password` issues with PHP < 7.4
# https://www.php.net/manual/en/mysqli.requirements.php
# TODO: change to ubuntu-latest when we no longer support PHP < 7.4
runs-on: ubuntu-16.04
continue-on-error: ${{ matrix.allowed_failure }}
strategy:
fail-fast: false
matrix:
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4' ]
wp: [ '5.6', '5.7' ]
allowed_failure: [ false ]
include:
- php: '8.0'
wp: '5.6'
allowed_failure: true
- php: '8.0'
wp: '5.7'
allowed_failure: true
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
# https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions
extensions: curl, dom, exif, fileinfo, hash, json, mbstring, mysqli, libsodium, openssl, pcre, imagick, xml, zip
- name: Install Composer dependencies (PHP < 8.0 )
if: ${{ matrix.php < 8.0 }}
uses: ramsey/composer-install@v1
- name: Install Composer dependencies (PHP >= 8.0)
if: ${{ matrix.php >= 8.0 }}
uses: ramsey/composer-install@v1
with:
composer-options: --ignore-platform-reqs
- name: Start MySQL service
run: sudo systemctl start mysql.service
- name: Install WordPress test site
run: bash bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wp }}
- name: Run PHPCS diff tests
# TODO: remove this condition when a new version of WPCS is released
# @see https://github.com/Automattic/Edit-Flow/issues/638#issuecomment-825511819
if: ${{ matrix.php < 8.0 }}
run: bash bin/phpcs-diff.sh
- name: Run PHPUnit tests (single site)
run: composer integration
- name: Run PHPUnit tests (multisite)
run: composer integration-ms