language: php

sudo: false

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

services:
  - mysql

matrix:
  fast_finish: true
  include:
  # Laravel 5.5
  - php: 7.1
    env: LARAVEL=5.5.* TESTBENCH=3.5.* ORCHESTRA_DATABASE=3.5.* PHPUNIT=~6.0
  - php: 7.2
    env: LARAVEL=5.5.* TESTBENCH=3.5.* ORCHESTRA_DATABASE=3.5.* PHPUNIT=~6.0

  # Laravel 5.6
  - php: 7.1
    env: LARAVEL=5.6.* TESTBENCH=3.6.* ORCHESTRA_DATABASE=3.6.* PHPUNIT=~7.0
  - php: 7.2
    env: LARAVEL=5.6.* TESTBENCH=3.6.* ORCHESTRA_DATABASE=3.6.* PHPUNIT=~7.0

  # Laravel 5.7
  - php: 7.1
    env: LARAVEL=5.7.* TESTBENCH=3.7.* ORCHESTRA_DATABASE=3.7.* PHPUNIT=~7.5
  - php: 7.2
    env: LARAVEL=5.7.* TESTBENCH=3.7.* ORCHESTRA_DATABASE=3.7.* PHPUNIT=~7.5
  - php: 7.3
    env: LARAVEL=5.7.* TESTBENCH=3.7.* ORCHESTRA_DATABASE=3.7.* PHPUNIT=~7.5

# Laravel 5.8
  - php: 7.1
    env: LARAVEL=5.8.* TESTBENCH=3.8.* ORCHESTRA_DATABASE=3.8.* PHPUNIT=~7.5
  - php: 7.2
    env: LARAVEL=5.8.* TESTBENCH=3.8.* ORCHESTRA_DATABASE=3.8.* PHPUNIT=~8.0
  - php: 7.3
    env: LARAVEL=5.8.* TESTBENCH=3.8.* ORCHESTRA_DATABASE=3.8.* PHPUNIT=~8.0

before_install:
  - phpenv config-rm xdebug.ini
  - composer self-update --stable --no-interaction
  - composer require orchestra/testbench:$TESTBENCH orchestra/database:$ORCHESTRA_DATABASE phpunit/phpunit:$PHPUNIT --no-update --no-interaction --dev
  - mysql -e 'CREATE DATABASE IF NOT EXISTS laravel_excel;'

install:
  - travis_retry composer install --no-suggest --no-interaction

script:
  - vendor/bin/phpunit --verbose --configuration phpunit.xml.dist
