# DO NOT EDIT THIS FILE!
#
# It's auto-generated by sonata-project/dev-kit package.

language: php

php:
  - '5.3'
  - '5.4'
  - '5.5'
  - '5.6'
  - '7.0'
  - nightly
  - hhvm

sudo: false

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

env:
  global:
    - PATH="$HOME/.local/bin:$PATH"
    - SYMFONY_DEPRECATIONS_HELPER=weak
    - TARGET=test

matrix:
  fast_finish: true
  include:
    - php: '7.0'
      env: TARGET=docs
    - php: '5.3'
      env: COMPOSER_FLAGS="--prefer-lowest"
    - php: '7.0'
      env: SYMFONY_VERSION=2.3.*
    - php: '7.0'
      env: SYMFONY_VERSION=2.6.*
    - php: '7.0'
      env: SYMFONY_VERSION=2.7.*
    - php: '7.0'
      env: SYMFONY_VERSION=2.8.*
    - php: '7.0'
      env: SYMFONY_VERSION=3.0.*
    - php: '7.0'
      env: SYMFONY_VERSION=dev-master@dev
    - php: '7.0'
      env: SYMFONY_DEPRECATIONS_HELPER=0
  allow_failures:
    - php: nightly
    - php: hhvm
    - env: SYMFONY_DEPRECATIONS_HELPER=0
    - env: SYMFONY_VERSION=dev-master@dev

before_install:
  - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then mv "$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini" /tmp; fi;
  - if [ "$TARGET" = 'test' ]; then composer self-update --stable; fi;
  - if [ "$TARGET" = 'test' ]; then composer config --quiet --global github-oauth.github.com $GITHUB_OAUTH_TOKEN; fi;
  - if [ "$TARGET" = 'test' ]; then sed --in-place "s/\"dev-master\":/\"dev-${TRAVIS_COMMIT}\":/" composer.json; fi;
  - if [ "$TARGET" = 'test' -a "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;

install:
  - if [ "$TARGET" = 'test' ]; then mkdir "$HOME/bin"; fi;
  - if [[ "$TARGET" = 'test' && "$TRAVIS_PHP_VERSION" < '5.6' ]]; then wget https://phar.phpunit.de/phpunit-old.phar --output-document="$HOME/bin/phpunit"; fi
  - if [[ "$TARGET" = 'test' && ! "$TRAVIS_PHP_VERSION" < '5.6' ]]; then wget https://phar.phpunit.de/phpunit.phar --output-document="$HOME/bin/phpunit"; fi
  - if [ "$TARGET" = 'test' ]; then chmod u+x "$HOME/bin/phpunit"; fi;
  - if [ "$TARGET" = 'test' ]; then travis_wait composer update --prefer-dist --no-interaction --prefer-stable $COMPOSER_FLAGS; fi;
  - if [ "$TARGET" = 'docs' ]; then pip install -r Resources/doc/requirements.txt --user `whoami`; fi;

before_script:
  - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then mv /tmp/xdebug.ini "$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d"; fi;

script: make $TARGET
