language: php

sudo: false

notifications:
    email:
        - deploy@peter-gribanov.ru

branches:
  except:
    - /^analysis-.*$/

matrix:
    fast_finish: true
    include:
        - php: 7.3
        - php: 7.2
        - php: 7.1
        - php: 7.0
        - php: 5.6
        - php: 5.5
          dist: trusty
        - php: 5.4
          dist: trusty
          env: SYMFONY_VERSION=2.8.*
        - php: 5.5
          dist: trusty
          env: SYMFONY_VERSION=3.4.*
        - php: 7.1
          env: SYMFONY_VERSION=4.2.* PHPUNIT_VERSION=5.7.*
        - php: 7.1
          env: SYMFONY_VERSION=4.3.* PHPUNIT_VERSION=5.7.*

before_install:
    - echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
    - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;

before_script:
    - if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --dev --no-update; fi;
    - if [ "$PHPUNIT_VERSION" != "" ]; then composer require "phpunit/phpunit:${PHPUNIT_VERSION}" --dev --no-update; fi;
    - composer install --prefer-dist --no-interaction --no-scripts --no-progress

script:
    - vendor/bin/phpunit --coverage-clover build/coverage-clover.xml

after_script:
    - vendor/bin/ocular code-coverage:upload --format=php-clover build/coverage-clover.xml
    - vendor/bin/coveralls -v -c .coveralls.yml
