language: php
sudo: required
services:
  - docker
env:
  DOCKER_COMPOSE_VERSION: 1.8.1

matrix:
  include:
    - php: 5.4
      env: 
        - DEPS="low"
    - php: 5.5
    - php: 5.6
    - php: 7.0
      env: 
        - TEST_COVERAGE=true
    - php: 7.0
      env: 
        - DEPS="lock"
    - php: 7.1
    - php: hhvm
  allow_failures:
    - php: hhvm
  fast_finish: true

install:
  - if [[ $TEST_COVERAGE ]]; then PHPUNIT_FLAGS="--coverage-clover ./build/logs/clover.xml"; fi

  - if [[ $DEPS == "low" ]]; then composer update --prefer-lowest --prefer-dist --prefer-stable --no-interaction; fi
  - if [[ $DEPS == "lock" ]]; then composer install --prefer-dist --no-interaction; fi
  - if [[ !$DEPS ]]; then composer update --prefer-dist --prefer-stable --no-interaction; fi

before_script:
  - docker-compose --version
  - docker-compose up -d
  - docker-compose ps
script:
  - vendor/bin/phpunit -v $PHPUNIT_FLAGS

after_success:
  - if [[ $TEST_COVERAGE ]]; then php vendor/bin/coveralls -v; fi
  - if [[ $TEST_COVERAGE ]]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi

language: php
sudo: required
services:
  - docker
env:
  global:
    DOCKER_COMPOSE_VERSION: 1.8.1

matrix:
  include:
    - php: 5.4
      env: 
        - DEPS="low"
    - php: 5.5
    - php: 5.6
    - php: 7.0
      env: 
        - TEST_COVERAGE=true
    - php: 7.0
      env: 
        - DEPS="lock"
    - php: 7.1
    - php: hhvm
  allow_failures:
    - php: hhvm
  fast_finish: true

install:
  - if [[ $TEST_COVERAGE ]]; then PHPUNIT_FLAGS="--coverage-clover ./build/logs/clover.xml"; fi

  - if [[ $DEPS == "low" ]]; then composer update --prefer-lowest --prefer-dist --prefer-stable --no-interaction; fi
  - if [[ $DEPS == "lock" ]]; then composer install --prefer-dist --no-interaction; fi
  - if [[ !$DEPS ]]; then composer update --prefer-dist --prefer-stable --no-interaction; fi

before_script:
  - docker-compose up -d

script:
  - vendor/bin/phpunit -v $PHPUNIT_FLAGS
  - docker-compose logs

after_success:
  - if [[ $TEST_COVERAGE ]]; then php vendor/bin/coveralls -v; fi
  - if [[ $TEST_COVERAGE ]]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi

Fix the Travis matrix; inspect the docker logs after the build
Fix the Travis matrix; inspect the docker logs after the build
