language: php

cache:
  directories:
    - .phpunit
    - $HOME/.composer/cache/files

branches:
  only:
    - master
    - /^\d+\.\d+$/

matrix:
  fast_finish: true
  include:
    # lowest dependencies
    - php: 7.1
      env: COMPOSER_FLAGS="--prefer-lowest"
    # Symfony 3 LTS
    - php: 7.2
      env: SYMFONY_LTS='^3'
    # Symfony 4
    - php: 7.3
    # development dependencies
    - php: 7.4snapshot
      env: DEPENDENCIES='dev'
  allow_failures:
    - php: 7.4snapshot
      env: DEPENDENCIES='dev'

before_install:
  - echo "memory_limit=4G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  - phpenv config-rm xdebug.ini || true
  - if [ "$DEPENDENCIES" != "" ]; then composer config minimum-stability $DEPENDENCIES; fi
  - if [ "$SYMFONY_LTS" != "" ]; then composer require --dev --no-update symfony/lts=$SYMFONY_LTS; fi

install:
  - composer update $COMPOSER_FLAGS --prefer-dist
  - ./phpunit install

script: ./phpunit
