Skip to content

Commit

Permalink
Test against HHVM in PHP7 mode through docker as facebook/hhvm#7198 e…
Browse files Browse the repository at this point in the history
…tc aren't backported to a Travis-supported version
  • Loading branch information
dvdoug committed Aug 13, 2017
1 parent 8082bd4 commit d4cda78
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ sudo: false
matrix:
include:
- php: hhvm
sudo: required
services:
- docker
- php: 5.4
env: lowest=1
- php: 5.5
Expand All @@ -18,15 +21,24 @@ cache:

install:
- |
if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then
if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then
docker pull hhvm/hhvm:latest;
docker run hhvm/hhvm:latest hhvm --version;
docker run --name hhvmapt hhvm/hhvm:latest bash -c "apt update -y; apt install -y dialog apt-utils wget curl git";
docker commit hhvmapt dvdoug/hhvm:apt;
docker run --name hhvmcomposer dvdoug/hhvm:apt bash -c "/usr/bin/curl https://getcomposer.org/installer | hhvm -d hhvm.php7.all=1 --php -- /dev/stdin --install-dir=/usr/local/bin --filename=composer";
docker commit hhvmcomposer dvdoug/hhvm:composer;
else
phpenv config-rm xdebug.ini || true;
fi;
- |
if [ "$lowest" = "1" ]; then
if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then
docker run -v $(pwd):/var/source dvdoug/hhvm:composer hhvm -d hhvm.php7.all=1 /usr/local/bin/composer update --working-dir /var/source;
elif [ "$lowest" = "1" ]; then
composer update --prefer-lowest --prefer-stable;
else
composer install;
composer update;
fi;
before_script:
Expand All @@ -37,15 +49,17 @@ before_script:
script:
- |
if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "$TRAVIS_PHP_VERSION" != "5.4" ] && [ "$TRAVIS_PHP_VERSION" != "5.5" ] && [ "$TRAVIS_PHP_VERSION" != "5.6" ]; then
if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then
docker run -v $(pwd):/var/source dvdoug/hhvm:composer hhvm -d hhvm.php7.all=1 /var/source/vendor/bin/phpunit /var/source/tests;
elif [ "$TRAVIS_PHP_VERSION" = "7.1" ]; then
phpdbg -qrr vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover tests;
else
php vendor/bin/phpunit;
fi;
after_script:
- |
if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "$TRAVIS_PHP_VERSION" != "5.4" ] && [ "$TRAVIS_PHP_VERSION" != "5.5" ] && [ "$TRAVIS_PHP_VERSION" != "5.6" ]; then
if [ "$TRAVIS_PHP_VERSION" = "7.1" ]; then
wget https://scrutinizer-ci.com/ocular.phar;
php ocular.phar code-coverage:upload --format=php-clover coverage.clover;
fi;

0 comments on commit d4cda78

Please sign in to comment.