123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- language: php
- sudo: false
- git:
- depth: 1
- env:
- global:
- - DEFAULT_COMPOSER_FLAGS="--no-interaction --no-progress --optimize-autoloader"
- - TASK_TESTS=1
- - TASK_TESTS_COVERAGE=0
- - TASK_CS=1
- - TASK_SCA=0
- matrix:
- fast_finish: true
- include:
- - php: 7.0
- env: DEPLOY=yes TASK_TESTS_COVERAGE=1
- - php: 7.1
- env: TASK_SCA=1
- - php: 5.3
- env: SKIP_LINT_TEST_CASES=1 COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
- - php: 5.4
- env: SKIP_LINT_TEST_CASES=1
- - php: 5.5
- env: SKIP_LINT_TEST_CASES=1
- - php: 5.6
- - php: 7.1
- env: SYMFONY_VERSION="^2.8"
- # Use the newer stack for HHVM as HHVM does not support Precise anymore since a long time and so Precise has an outdated version
- - php: hhvm-3.9
- env: SKIP_LINT_TEST_CASES=1
- sudo: required
- dist: trusty
- group: edge
- - php: hhvm
- env: SKIP_LINT_TEST_CASES=1
- sudo: required
- dist: trusty
- group: edge
- cache:
- directories:
- - $HOME/.composer/cache
- before_install:
- # check phpdbg
- - phpdbg --version 2> /dev/null || { echo 'No phpdbg'; export TASK_TESTS_COVERAGE=0; }
- # turn off XDebug
- - phpenv config-rm xdebug.ini || return 0
- # validate tasks configuration
- - if [ $TASK_TESTS == 0 ] && [ $TASK_TESTS_COVERAGE == 1 ]; then travis_terminate 1; fi
- # for building a tag release we don't need to run SCA tools, collect code coverage or self-fix CS
- - if [ $TRAVIS_TAG ]; then export TASK_SCA=0; fi
- - if [ $TRAVIS_TAG ]; then export TASK_TESTS_COVERAGE=0; fi
- - if [ $TRAVIS_TAG ]; then export TASK_CS=0; fi
- # Composer: boost installation
- - travis_retry composer global require $DEFAULT_COMPOSER_FLAGS hirak/prestissimo
- # Composer: enforce given Symfony components version
- - 'if [ "$SYMFONY_VERSION" != "" ]; then sed -i "s/\"symfony\/\([^\"]*\)\": \"^2[^\"]*\"/\"symfony\/\1\": \"$SYMFONY_VERSION\"/g" composer.json; fi'
- # display tasks configuration for a job
- - set | grep ^TASK | sort
- install:
- - travis_retry composer update $DEFAULT_COMPOSER_FLAGS $COMPOSER_FLAGS
- - composer info -D | sort
- script:
- - if [ $TASK_SCA == 1 ]; then php php-cs-fixer fix --rules declare_strict_types,native_function_invocation -q; fi
- - if [ $TASK_SCA == 1 ]; then files_with_trailing_spaces=`find . -type f -not -path "./.git/*" -not -path "./vendor/*" -not -path "./tests/Fixtures/*" -exec egrep -nH " $" {} \;` && [[ $files_with_trailing_spaces ]] && echo $files_with_trailing_spaces && travis_terminate 1 || echo "No trailing spaces detected."; fi
- - if [ $TASK_TESTS == 1 ] && [ $TASK_TESTS_COVERAGE == 0 ]; then vendor/bin/phpunit --verbose; fi
- - if [ $TASK_TESTS == 1 ] && [ $TASK_TESTS_COVERAGE == 1 ]; then phpdbg -qrr vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml; fi
- - if [ $TASK_SCA == 1 ]; then git checkout . -q; fi
- - if [ $TASK_CS == 1 ]; then php php-cs-fixer --diff --dry-run -v fix; fi
- after_success:
- - if [ $TASK_TESTS_COVERAGE == 1 ]; then php vendor/bin/coveralls -v; fi
- before_deploy:
- # install box2
- - curl -LSs http://box-project.github.io/box2/installer.php | php
- - php box.phar --version
- # ensure that deps will work on lowest supported PHP version
- - composer config platform.php 2> /dev/null || composer config platform.php 5.3.6
- # update deps to highest possible for lowest supported PHP version
- - composer update $DEFAULT_COMPOSER_FLAGS --no-dev --prefer-stable
- - composer info -D | sort
- # build phar file
- - php -d phar.readonly=false box.phar build
- deploy:
- provider: releases
- api_key:
- secure: K9NKi7X1OPz898fxtVc1RfWrSI+4hTFFYOik932wTz1jC4dQJ64Khh1LV9frA1+JiDS3+R6TvmQtpzbkX3y4L75UrSnP1ADH5wfMYIVmydG3ZjTMo8SWQWHmRMh3ORAKTMMpjl4Q7EkRkLp6RncKe+FAFPP5mgv55mtIMaE4qUk=
- file: php-cs-fixer.phar
- skip_cleanup: true
- on:
- repo: FriendsOfPHP/PHP-CS-Fixer
- tags: true
- condition: $DEPLOY = yes
|