dist: xenial
language: php

env:
  global:
    - SETUP=stable

matrix:
  fast_finish: true
  include:
    # - php: 7.2
    - php: 7.2
      env: SETUP=lowest
    # - php: 7.3
    - php: 7.3
      env: SETUP=lowest

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

before_install:
  - travis_retry composer self-update
  - travis_retry composer dumpautoload

install:
  - if [[ $SETUP = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi
  - if [[ $SETUP = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-suggest; fi

script: vendor/bin/phpunit --coverage-clover=coverage.xml --coverage-text

after_success:
    - bash <(curl -s https://codecov.io/bash)
