language: php

sudo: false

services:
  - mongodb

matrix:
  fast_finish: true
  include:
      # 3.4.*
    - php: 7.1
      env: SYMFONY_VERSION=3.4.*
    - php: 7.2
      env: SYMFONY_VERSION=3.4.*
    - php: 7.3
      env: SYMFONY_VERSION=3.4.*
      # 4.3.*
    - php: 7.1
      env: SYMFONY_VERSION=4.3.*
    - php: 7.2
      env: SYMFONY_VERSION=4.3.*
    - php: 7.3
      env: SYMFONY_VERSION=4.3.*
      # 4.4.*
    - php: 7.1
      env: SYMFONY_VERSION=4.4.*
    - php: 7.2
      env: SYMFONY_VERSION=4.4.*
    - php: 7.3
      env: SYMFONY_VERSION=4.4.*
      # 5.0.*
    - php: 7.2
      env: SYMFONY_VERSION=5.0.*
    - php: 7.3
      env: SYMFONY_VERSION=5.0.*

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

before_install:
  - pecl install -f mongodb-stable
  - echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  - composer selfupdate
  - if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;

install:
  - composer config "platform.ext-mongo" "1.6.16" && composer require alcaeus/mongo-php-adapter --prefer-dist --no-interaction $COMPOSER_FLAGS
  - composer update --prefer-dist --no-interaction $COMPOSER_FLAGS

script:
  - ./bin/phpspec run -fpretty --verbose
