language: php

php:
  - 7.1
  - 7.2
  - 7.3
  - 7.4
  - nightly

sudo: false

matrix:
  allow_failures:
    - php: nightly
  fast_finish: true

env:
  - AMP_DEBUG=true

before_install:
  - phpenv config-rm xdebug.ini || echo "No xdebug config."

install:
  - composer update -n --prefer-dist

script:
  - phpdbg -qrr vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml;
  - PHP_CS_FIXER_IGNORE_ENV=1 php vendor/bin/php-cs-fixer --diff --dry-run -v fix

after_script:
  - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar
  - chmod +x php-coveralls.phar
  - travis_retry ./php-coveralls.phar -v

cache:
  directories:
    - $HOME/.composer/cache
    - $HOME/.php-cs-fixer
    - $HOME/.local

