-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
110 lines (94 loc) · 3.16 KB
/
.travis.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
language: php
php:
# see http://php.net/supported-versions.php
- '7.3' # Until 6 Dec 2021
- '7.4' # Until 28 Nov 2022
addons:
apt:
packages:
- parallel
env:
global:
- COMPOSER_CACHE_DIR=/home/travis/.composer
- XDEBUG_MODE=coverage
matrix:
# Only contains widely used or supported versions
#
# see https://codex.wordpress.org/WordPress_Versions (patched recently)
# see https://phpunit.de/supported-versions.html
- WP_VERSION=4.8.*
- WP_VERSION=5.0.*
- WP_VERSION=5.2.*
- WP_VERSION=5.4.*
- WP_VERSION=5.6.*
matrix:
include:
# Bleeding edge (the latest stable of all)
- php: '8.0'
env: WP_VERSION=5.6.*
# Lowest edge as described in README.md
- php: '7.0'
env: WP_VERSION=4.8.*
#
# Checking deprecated PHP versions
#
- php: '7.2'
env: WP_VERSION=5.5.*
- php: '7.1'
env: WP_VERSION=5.3.*
- php: '7.0'
env: WP_VERSION=5.2.*
#
# Trying to support ... (first entry indicates what we try to support)
#
- php: '5.6'
env: WP_VERSION=4.8.*
- env: WP_VERSION=4.7.*
php: '7.0'
- php: 'hhvm'
env: WP_VERSION=5.4.*
# ... upcoming versions
- php: 'nightly'
env: WP_VERSION=5.4.*
- env: WP_VERSION=dev-master
php: 7.4
# all above are allowed to fail because they just check the compatibility
allow_failures:
- php: '5.6'
- php: 'hhvm'
- php: 'nightly'
- env: WP_VERSION=dev-master
# Do not wait for allowed failures
fast_finish: true
services:
- mysql
cache:
directories:
- /home/travis/.composer
before_install:
- mysql -e 'CREATE DATABASE dev;'
# Disable PHPStan because it gives false-positives PHP < 7.1
- "[[ $TRAVIS_PHP_VERSION > '7.0' ]] || rm -rf etc/phpstan"
# Try supporting other versions
- "[[ $WP_VERSION != *'dev-master' ]] || composer config minimum-stability dev"
- "[[ $WP_VERSION != *'dev-master' ]] || composer config prefer-stable true"
- composer require --update-with-dependencies johnpbloch/wordpress:$WP_VERSION
# PHP8 compat
- "[[ $TRAVIS_PHP_VERSION != 8.0 ]] || composer bin wp update --ignore-platform-reqs --no-scripts"
install:
- composer install --no-scripts
# Using WP-CLI instead of Composer because this way we can use the env matrix (above).
- vendor/bin/wp --allow-root config create --skip-check --force --dbuser=travis --dbpass="" --dbhost="127.0.0.1"
- vendor/bin/wp --allow-root core install --skip-email
- ln -s etc/.coveralls.yml
script:
- "[[ $WP_VERSION == *'dev-master' ]] || composer validate --strict --no-check-lock"
- vendor/bin/phpunit -c etc/phpunit/phpunit.xml.dist --coverage-clover coverage.xml
# Code quality checks should not differ among different PHP versions, so we spare runtime here
- "[[ $TRAVIS_PHP_VERSION != 7.3 ]] || vendor/bin/phpstan analyse -c etc/phpstan/phpstan.neon.dist lib/"
- "[[ $TRAVIS_PHP_VERSION != 7.3 ]] || vendor/bin/phpcs --standard=etc/phpcs/phpcs.xml.dist -s lib/"
after_success:
- composer bin php-coveralls require php-coveralls/php-coveralls
- travis_retry php vendor/bin/php-coveralls -c etc/coveralls.yml -v
after_failure:
- cat srv/wp-content/debug.log || true