Permalink
77 lines (67 sloc) 2.72 KB
language: php
sudo: false
git:
depth: 1
cache:
directories:
- $HOME/.composer/cache
- $HOME/.app/cache
env:
global:
- deps="no"
- SYMFONY_VERSION=""
- CHECK_PHP_SYNTAX="no"
- SYMFONY_DEPRECATIONS_HELPER="weak"
- ENABLE_CODE_COVERAGE="false"
matrix:
fast_finish: true
include:
# bleeding edge (unreleased dev versions where failures are allowed)
- php: nightly
env: SYMFONY_VERSION="dev-master"
# stable (most recent stable versions)
- php: 7.1
env:
- SYMFONY_VERSION="3.2.*"
- TWIG_VERSION="2.x-dev"
- CHECK_PHP_SYNTAX="yes"
# common (some popular version combinations)
- php: 7.0
env: SYMFONY_VERSION="3.1.*"
# common (some popular version combinations)
- php: 5.6
env:
- SYMFONY_VERSION="2.8.*"
- ENABLE_CODE_COVERAGE="true"
# legacy (oldest supported versions)
- php: 5.3
env:
- SYMFONY_VERSION="2.3.*"
- COMPOSER_FLAGS="--prefer-lowest"
allow_failures:
- php: nightly
# code coverage is very slow; allow a failure to get the Travis result early
- env:
- SYMFONY_VERSION="2.8.*"
- ENABLE_CODE_COVERAGE="true"
before_install:
- stty cols 120
- INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo memory_limit = -1 >> $INI_FILE
- echo session.gc_probability = 0 >> $INI_FILE
- echo opcache.enable_cli = 1 >> $INI_FILE
- if [[ "SYMFONY_VERSION" == "2.8.*" || "SYMFONY_VERSION" == 3.* ]]; then export SYMFONY_DEPRECATIONS_HELPER="strict"; fi;
- if [[ "$ENABLE_CODE_COVERAGE" != "true" ]]; then rm -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini; fi;
- composer self-update
- if [[ "$SYMFONY_VERSION" != "" ]]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
- if [[ "$TWIG_VERSION" != "" ]]; then composer require "twig/twig:${TWIG_VERSION}" --no-update; fi;
install:
- if [[ "$CHECK_PHP_SYNTAX" == "yes" ]]; then composer require --dev --no-update friendsofphp/php-cs-fixer; fi;
- composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
- if [[ "$ENABLE_CODE_COVERAGE" == "true" ]]; then composer require --dev satooshi/php-coveralls; fi
script:
- if [[ "$ENABLE_CODE_COVERAGE" == "true" ]]; then vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml; else vendor/bin/phpunit; fi;
- if [[ "$CHECK_PHP_SYNTAX" == "yes" ]]; then php vendor/bin/php-cs-fixer --no-interaction --dry-run --diff -v fix; fi;
- if [[ "$CHECK_PHP_SYNTAX" == "yes" ]]; then mv ./.php_cs.cache $HOME/.app/cache/.php_cs.cache 2> /dev/null; fi;
after_success: |
if [[ "$ENABLE_CODE_COVERAGE" == "true" ]]; then php vendor/bin/coveralls -v --config .coveralls.yml; fi;