forked from CybotAS/CookiebotWP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
104 lines (98 loc) · 2.68 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
os: linux
dist: bionic
services:
- mysql
language: php
cache:
directories:
- $HOME/.composer/cache
matrix:
fast_finish: true
include:
- php: 7.4
env: PHPCS=1
- php: 8.2
env:
- PHPUNIT_VERSION=9.6.7
- WP=latest
dist: jammy # Version 8.2 is not available in the "bionic", newer version is required.
addons:
apt:
packages:
- "libonig5" # This library is required, since Travis fails to properly install & run the PHP 8.2
- php: 8.1
env:
- PHPUNIT_VERSION=9.6.7
- WP=latest
- php: 8.0
env:
- PHPUNIT_VERSION=9.6.7
- WP=latest
- php: 7.4
env:
- PHPUNIT_VERSION=7.5.20
- WP=latest
- php: 7.3
env:
- PHPUNIT_VERSION=7.5.20
- WP=latest
- php: 7.2
env:
- PHPUNIT_VERSION=7.5.20
- WP=latest
- php: 7.1
env:
- PHPUNIT_VERSION=7.5.20
- WP=6.5.5
- php: 7.0
env:
- PHPUNIT_VERSION=6.5.14
- WP=6.5.5
dist: xenial # Versions 7.0 and lower not available in "bionic", older version ("xenial") required to run
- php: 5.6
env:
- PHPUNIT_VERSION=5.7.27
- WP=6.2.2
dist: xenial
before_install:
- |
which composer
if ! composer --version; then
sudo apt-get update
sudo apt-get install -y php-cli unzip
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
PATH="/usr/local/bin:${PATH}"
which composer
fi
- composer --version
before_script:
- |
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
phpenv config-rm xdebug.ini
else
echo \"xdebug.ini does not exist\"
fi
- |
if [ "$PHPCS" == "1" ]; then
(cd tests && composer install)
else
# (as of 2021-10-05, certifi still stubbornly bundles the expired root;
# see https://github.com/certifi/python-certifi/pull/162
# and https://bugzilla.mozilla.org/show_bug.cgi?id=1733560 for updates)
sudo sed -re 's#^(mozilla/DST_Root_CA_X3.crt)$#!\1#' -i /etc/ca-certificates.conf;
sudo update-ca-certificates;
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt;
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP;
wget https://phar.phpunit.de/phpunit-$PHPUNIT_VERSION.phar -O /tmp/phpunit &&
chmod +x /tmp/phpunit
fi
script:
- |
if [ "$PHPCS" == "1" ]; then
tests/vendor/bin/phpcs
else
composer require yoast/phpunit-polyfills
/tmp/phpunit
WP_MULTISITE=1 /tmp/phpunit
fi