language: php
git:
  depth: 1
cache:
  directories:
  - "$HOME/.composer/cache"
sudo: false
env:
  global:
  - COMPOSER_ALLOW_XDEBUG=0
matrix:
  include:
  - php: 7.1
    env: CONTAO_VERSION='4.4.*'
  - php: 7.3
    env: CONTAO_VERSION='4.4.*'
  - php: 7.2
    env: CONTAO_VERSION='4.9.*'
  - php: 7.4
    env: CONTAO_VERSION='4.9.*'
  - php: 7.4
    env: COVERAGE=1 CONTAO_VERSION='4.9.*'
  allow_failures:
  - env: COVERAGE=1 DEFAULT=0
  fast_finish: true
before_install:
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- if [[ "$COVERAGE" != "1" ]]; then phpenv config-rm xdebug.ini || true; fi
install:
- composer require contao/core-bundle:${CONTAO_VERSION}
notifications:
  email:
    recipients:
    - digitales@heimrich-hannot.de
    on_success: never
    on_failure: always
before_script:
- travis_wait composer install --no-interaction
script:
- if [[ "$COVERAGE" = "1" ]]; then travis_retry mkdir -p build/logs; fi
- if [[ "$COVERAGE" = "1" ]]; then travis_retry php vendor/bin/phpunit --coverage-clover
  build/logs/clover.xml || true; fi
after_script:
- if [[ "$COVERAGE" = "1" ]]; then travis_retry php vendor/bin/php-coveralls -v; fi
