Skip to content

Commit

Permalink
Use Travis output folding
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Oct 30, 2020
1 parent 5733651 commit 9a22fff
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,43 @@ matrix:
- SKIP_CS_FIXER=1

before_install:
- phpenv config-rm xdebug.ini || echo "xDebug not disabled"
- composer global require --no-progress --no-scripts --no-plugins symfony/flex
- phpenv config-rm xdebug.ini || echo "xDebug not disabled"
- composer global require --no-progress --no-scripts --no-plugins symfony/flex
- |
# inspired by Symfony's tfold helper, folds the output of successful commands
tfold () {
local title="$1"
local fold=$(echo $title | sed -r 's/[^-_A-Za-z0-9]+/./g')
shift
echo -e "travis_fold:start:$fold"
echo -e "\\e[1;34m$title\\e[0m"
bash -xc "$*" 2>&1
local ok=$?
(exit $ok) && echo -e "travis_fold:end:$fold"
(exit $ok)
}
export -f tfold
install:
- rm -rf composer.lock vendor/*
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
- composer require phpunit/phpunit:${PHPUNIT_VERSION:-"8.*"} --update-with-all-dependencies

script:
before_script:
- cp tests/Functional/app/parameters.yml.dist tests/Functional/app/parameters.yml
- rm -rf tests/Functional/cache
- if [[ ${SKIP_CS_FIXER} != "1" ]]; then make php_cs_fixer_check; fi
- make phpstan

script:
- if [[ ${SKIP_CS_FIXER} != "1" ]]; then tfold 'PHP CS Fixer' make php_cs_fixer_check; fi
- tfold 'PHPStan' make phpstan
- |
if [[ ${TEST_COVERAGE} ]]; then phpdbg -qrr vendor/bin/phpunit -c tests/ --coverage-clover ./build/logs/clover.xml;
elif [[ ${PHPUNIT_VERSION} == "7.*" ]]; then vendor/bin/phpunit -c tests/phpunit7.xml tests/;
else vendor/bin/phpunit -c tests/ tests/;
if [[ ${TEST_COVERAGE} ]]; then tfold 'PHPUnit with Coverage' phpdbg -qrr vendor/bin/phpunit -c tests/ --coverage-clover ./build/logs/clover.xml;
elif [[ ${PHPUNIT_VERSION} == "7.*" ]]; then tfold 'PHPUnit 7' vendor/bin/phpunit -c tests/phpunit7.xml tests/;
else tfold 'PHPUnit' vendor/bin/phpunit -c tests/ tests/;
fi
- vendor/bin/behat -c tests/behat.yml -fprogress
- tfold 'Behat' vendor/bin/behat -c tests/behat.yml -fprogress

after_success:
- if [[ ${TEST_COVERAGE} ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
Expand Down

0 comments on commit 9a22fff

Please sign in to comment.