Skip to content

Commit a2c6002

Browse files
authored
Merge pull request #209 from clue-labs/php7.4
Run tests on PHP 7.4 and simplify test matrix and test setup
2 parents 646fbbd + b98bb2f commit a2c6002

File tree

2 files changed

+41
-59
lines changed

2 files changed

+41
-59
lines changed

.travis.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
language: php
22

3-
php:
4-
# - 5.3 # requires old distro, see below
5-
# - 5.4 # requires old distro, see below
6-
# - 5.5 # requires old distro, see below
7-
- 5.6
8-
- 7.0
9-
- 7.1
10-
- 7.2
11-
- 7.3
12-
# - hhvm # requires legacy phpunit & ignore errors, see below
13-
143
# lock distro so new future defaults will not break the build
154
dist: xenial
165

@@ -25,9 +14,17 @@ matrix:
2514
- php: 5.5
2615
dist: trusty
2716
before_install: [] # skip libuv
28-
- php: hhvm
29-
install: composer require phpunit/phpunit:^5 --dev --no-interaction
17+
- php: 5.6
18+
- php: 7.0
19+
- php: 7.1
20+
- php: 7.2
21+
- php: 7.3
22+
- php: 7.4
23+
- php: hhvm-3.18
24+
dist: trusty
3025
before_install: [] # skip libuv
26+
install:
27+
- composer require phpunit/phpunit:^5 --dev --no-interaction # requires legacy phpunit & skip ./travis-init.sh
3128
- name: "Windows"
3229
os: windows
3330
language: shell # no built-in php support
@@ -66,7 +63,7 @@ matrix:
6663
install:
6764
- composer install
6865
allow_failures:
69-
- php: hhvm
66+
- php: hhvm-3.18
7067
- os: windows
7168

7269
sudo: false

travis-init.sh

Lines changed: 30 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,37 @@
22
set -e
33
set -o pipefail
44

5-
if [[ "$TRAVIS_PHP_VERSION" != "hhvm" &&
6-
"$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]]; then
7-
8-
# install 'event' and 'ev' PHP extension
9-
if [[ "$TRAVIS_PHP_VERSION" != "5.3" &&
10-
"$TRAVIS_PHP_VERSION" != "7.3" ]]; then
11-
echo "yes" | pecl install event
12-
echo "yes" | pecl install ev
13-
fi
14-
15-
# install 'libevent' PHP extension (does not support php 7)
16-
if [[ "$TRAVIS_PHP_VERSION" != "7.0" &&
17-
"$TRAVIS_PHP_VERSION" != "7.1" &&
18-
"$TRAVIS_PHP_VERSION" != "7.2" &&
19-
"$TRAVIS_PHP_VERSION" != "7.3" ]]; then
20-
curl http://pecl.php.net/get/libevent-0.1.0.tgz | tar -xz
21-
pushd libevent-0.1.0
22-
phpize
23-
./configure
24-
make
25-
make install
26-
popd
27-
echo "extension=libevent.so" >> "$(php -r 'echo php_ini_loaded_file();')"
28-
fi
5+
# install 'event' and 'ev' PHP extension on PHP 5.4+ only
6+
if [[ "$TRAVIS_PHP_VERSION" != "5.3" ]]; then
7+
echo "yes" | pecl install event
8+
echo "yes" | pecl install ev
9+
fi
2910

30-
# install 'libev' PHP extension (does not support php 7)
31-
if [[ "$TRAVIS_PHP_VERSION" != "7.0" &&
32-
"$TRAVIS_PHP_VERSION" != "7.1" &&
33-
"$TRAVIS_PHP_VERSION" != "7.2" &&
34-
"$TRAVIS_PHP_VERSION" != "7.3" ]]; then
35-
git clone --recursive https://github.com/m4rw3r/php-libev
36-
pushd php-libev
37-
phpize
38-
./configure --with-libev
39-
make
40-
make install
41-
popd
42-
echo "extension=libev.so" >> "$(php -r 'echo php_ini_loaded_file();')"
43-
fi
11+
# install 'libevent' PHP extension on legacy PHP 5 only
12+
if [[ "$TRAVIS_PHP_VERSION" < "7.0" ]]; then
13+
curl http://pecl.php.net/get/libevent-0.1.0.tgz | tar -xz
14+
pushd libevent-0.1.0
15+
phpize
16+
./configure
17+
make
18+
make install
19+
popd
20+
echo "extension=libevent.so" >> "$(php -r 'echo php_ini_loaded_file();')"
21+
fi
4422

45-
# install 'libuv' PHP extension (does not support php 5)
46-
if [[ "$TRAVIS_PHP_VERSION" = "7.0" ||
47-
"$TRAVIS_PHP_VERSION" = "7.1" ||
48-
"$TRAVIS_PHP_VERSION" = "7.2" ||
49-
"$TRAVIS_PHP_VERSION" = "7.3" ]]; then
50-
echo "yes" | pecl install uv-beta
51-
fi
23+
# install 'libev' PHP extension on legacy PHP 5 only
24+
if [[ "$TRAVIS_PHP_VERSION" < "7.0" ]]; then
25+
git clone --recursive https://github.com/m4rw3r/php-libev
26+
pushd php-libev
27+
phpize
28+
./configure --with-libev
29+
make
30+
make install
31+
popd
32+
echo "extension=libev.so" >> "$(php -r 'echo php_ini_loaded_file();')"
33+
fi
5234

35+
# install 'libuv' PHP extension on PHP 7+ only
36+
if ! [[ "$TRAVIS_PHP_VERSION" < "7.0" ]]; then
37+
echo "yes" | pecl install uv-beta
5338
fi

0 commit comments

Comments
 (0)