language: php

php:
  - 5.6
  - 5.5
  - 5.4
  - 5.3
  - 7.0
  - hhvm

matrix:
  allow_failures:
    - php: 5.3
    - php: hhvm
  fast_finish: true

branches:
  only:
    - master

install:
  - /bin/bash ansible/provision.sh

before_script:
  - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "$TRAVIS_PHP_VERSION" != "7" ]; then echo "extension=memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
  - if $(phpenv version-name | grep -q '5.3'); then sudo composer update --no-dev; sudo composer dump-autoload; fi

script:
  - make phpunit

after_script:
  - cat /var/log/elasticsearch/*.log
  - cat /var/log/nginx/*.log
  - sudo rm composer.lock && sudo composer require satooshi/php-coveralls dev-master --no-ansi --no-progress --no-interaction
  - vendor/bin/coveralls -v

after_success:
  - bash <(curl -s https://codecov.io/bash)
