language: php

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

matrix:
  fast_finish: true
  include:
    - php: 7.2
      env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.2
      env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.3
      env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.3
      env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.4
      env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.4
      env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.2
      env: LARAVEL='6.*' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.2
      env: LARAVEL='6.*' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.3
      env: LARAVEL='6.*' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.3
      env: LARAVEL='6.*' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.4
      env: LARAVEL='6.*' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.4
      env: LARAVEL='6.*' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.2
      env: LARAVEL='7.*' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.2
      env: LARAVEL='7.*' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.3
      env: LARAVEL='7.*' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.3
      env: LARAVEL='7.*' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.4
      env: LARAVEL='7.*' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.4
      env: LARAVEL='7.*' COMPOSER_FLAGS='--prefer-stable'

before_install:
  - travis_retry composer self-update
  - travis_retry composer require "illuminate/support:${LARAVEL}" --no-update --no-interaction

install:
  - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --no-suggest

script:
  - phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
