Skip to content

Commit

Permalink
Run tests on PHP 7.4 and simply test matrix and test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Dec 31, 2019
1 parent 6a89446 commit b98bb2f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 59 deletions.
25 changes: 11 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
language: php

php:
# - 5.3 # requires old distro, see below
# - 5.4 # requires old distro, see below
# - 5.5 # requires old distro, see below
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
# - hhvm # requires legacy phpunit & ignore errors, see below

# lock distro so new future defaults will not break the build
dist: xenial

Expand All @@ -25,9 +14,17 @@ matrix:
- php: 5.5
dist: trusty
before_install: [] # skip libuv
- php: hhvm
install: composer require phpunit/phpunit:^5 --dev --no-interaction
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: hhvm-3.18
dist: trusty
before_install: [] # skip libuv
install:
- composer require phpunit/phpunit:^5 --dev --no-interaction # requires legacy phpunit & skip ./travis-init.sh
- name: "Windows"
os: windows
language: shell # no built-in php support
Expand Down Expand Up @@ -66,7 +63,7 @@ matrix:
install:
- composer install
allow_failures:
- php: hhvm
- php: hhvm-3.18
- os: windows

sudo: false
Expand Down
75 changes: 30 additions & 45 deletions travis-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,37 @@
set -e
set -o pipefail

if [[ "$TRAVIS_PHP_VERSION" != "hhvm" &&
"$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]]; then

# install 'event' and 'ev' PHP extension
if [[ "$TRAVIS_PHP_VERSION" != "5.3" &&
"$TRAVIS_PHP_VERSION" != "7.3" ]]; then
echo "yes" | pecl install event
echo "yes" | pecl install ev
fi

# install 'libevent' PHP extension (does not support php 7)
if [[ "$TRAVIS_PHP_VERSION" != "7.0" &&
"$TRAVIS_PHP_VERSION" != "7.1" &&
"$TRAVIS_PHP_VERSION" != "7.2" &&
"$TRAVIS_PHP_VERSION" != "7.3" ]]; then
curl http://pecl.php.net/get/libevent-0.1.0.tgz | tar -xz
pushd libevent-0.1.0
phpize
./configure
make
make install
popd
echo "extension=libevent.so" >> "$(php -r 'echo php_ini_loaded_file();')"
fi
# install 'event' and 'ev' PHP extension on PHP 5.4+ only
if [[ "$TRAVIS_PHP_VERSION" != "5.3" ]]; then
echo "yes" | pecl install event
echo "yes" | pecl install ev
fi

# install 'libev' PHP extension (does not support php 7)
if [[ "$TRAVIS_PHP_VERSION" != "7.0" &&
"$TRAVIS_PHP_VERSION" != "7.1" &&
"$TRAVIS_PHP_VERSION" != "7.2" &&
"$TRAVIS_PHP_VERSION" != "7.3" ]]; then
git clone --recursive https://github.com/m4rw3r/php-libev
pushd php-libev
phpize
./configure --with-libev
make
make install
popd
echo "extension=libev.so" >> "$(php -r 'echo php_ini_loaded_file();')"
fi
# install 'libevent' PHP extension on legacy PHP 5 only
if [[ "$TRAVIS_PHP_VERSION" < "7.0" ]]; then
curl http://pecl.php.net/get/libevent-0.1.0.tgz | tar -xz
pushd libevent-0.1.0
phpize
./configure
make
make install
popd
echo "extension=libevent.so" >> "$(php -r 'echo php_ini_loaded_file();')"
fi

# install 'libuv' PHP extension (does not support php 5)
if [[ "$TRAVIS_PHP_VERSION" = "7.0" ||
"$TRAVIS_PHP_VERSION" = "7.1" ||
"$TRAVIS_PHP_VERSION" = "7.2" ||
"$TRAVIS_PHP_VERSION" = "7.3" ]]; then
echo "yes" | pecl install uv-beta
fi
# install 'libev' PHP extension on legacy PHP 5 only
if [[ "$TRAVIS_PHP_VERSION" < "7.0" ]]; then
git clone --recursive https://github.com/m4rw3r/php-libev
pushd php-libev
phpize
./configure --with-libev
make
make install
popd
echo "extension=libev.so" >> "$(php -r 'echo php_ini_loaded_file();')"
fi

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

0 comments on commit b98bb2f

Please sign in to comment.