language: php

sudo: false

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

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

matrix:
  fast_finish: true
  include:
    - php: 5.5
      env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak
    - php: 5.6
    # Symfony 3 LTS
    - php: 7.0
      env: SYMFONY_LTS='^3'
    # Symfony 4
    - php: 7.1
      env: SYMFONY_PHPUNIT_VERSION='6.5'
    - php: 7.2
    - php: 7.3
    # development dependencies
    - php: 7.2
      env: DEPENDENCIES='dev'
  allow_failures:
    - php: 7.2
      env: DEPENDENCIES='dev'

before_install:
  - echo "memory_limit=4G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then phpenv config-rm xdebug.ini || true; fi
  - 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
