language: php
sudo: false

php:
  - 5.5
  - 5.6
  - 7.0
  - 7.1
  - nightly
env:
  global:
    - COMPOSER_DISABLE_XDEBUG_WARN=1
    - PREFER_LOWEST=""

matrix:
  fast_finish: true
  include:
    - php: 7.1
      env: CODESTYLE="yes"
    - php: 7.1
      env: PREFER_LOWEST="--prefer-lowest"

before_script:
  - if [[ $TRAVIS_PHP_VERSION = hhvm ]]; then cat tests/travis.hhvm.ini >> /etc/hhvm/php.ini; else phpenv config-add tests/travis.php.ini; fi
  - travis_retry composer update --prefer-source $PREFER_LOWEST # Run once to install magento's composer merger
  - travis_retry composer update --prefer-source $PREFER_LOWEST # Run twice to install merged dependencies
  - mysql -e "SET GLOBAL sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY'"
  - phpunit --version

script:
  # Run PHPUnit if we're not checking code style, otherwise run phpcs
  - if [[ $CODESTYLE != "yes" ]]; then composer test; else composer phpcs; fi
cache:
  directories:
    - vendor
    - $HOME/.composer/cache

notifications:
  email: false

language: php
sudo: false

php:
  - 5.5
  - 5.6
  - 7.0
  - 7.1
  - nightly
env:
  global:
    - COMPOSER_DISABLE_XDEBUG_WARN=1
    - PREFER_LOWEST=""

matrix:
  fast_finish: true
  include:
    - php: 7.1
      env: CODESTYLE="yes"
    - php: 7.1
      env: PREFER_LOWEST="--prefer-lowest"
  allow_failures:
    - php: nightly

before_script:
  - if [[ $TRAVIS_PHP_VERSION = hhvm ]]; then cat tests/travis.hhvm.ini >> /etc/hhvm/php.ini; else phpenv config-add tests/travis.php.ini; fi
  - travis_retry composer update --prefer-source $PREFER_LOWEST # Run once to install magento's composer merger
  - travis_retry composer update --prefer-source $PREFER_LOWEST # Run twice to install merged dependencies
  - mysql -e "SET GLOBAL sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY'"
  - phpunit --version

script:
  # Run PHPUnit if we're not checking code style, otherwise run phpcs
  - if [[ $CODESTYLE != "yes" ]]; then composer test; else composer phpcs; fi
cache:
  directories:
    - vendor
    - $HOME/.composer/cache

notifications:
  email: false

Allow PHP 7.2 to fail
Allow PHP 7.2 to fail

This allows our tests to pass.