sudo: false

language: php

addons:
  postgresql: "9.2"

php:
  - 5.4
  - 5.5
  - 5.6
  - 7
  - hhvm

matrix:
    include:
        - php: 5.4
          env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
    allow_failures:
        - php: hhvm

before_script:
    - travis_retry composer self-update
    - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source
    - mysql -e 'create database phinx_testing;'
    - psql -c 'create database phinx_testing;' -U postgres

script:
    - phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
    - wget https://scrutinizer-ci.com/ocular.phar
    - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
