diff --git a/.travis.yml b/.travis.yml index 4d4a216f482..403023390aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,10 +16,7 @@ before_install: - wget http://cs.sensiolabs.org/get/php-cs-fixer.phar script: - - php ./tests/run-tests.php - - output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 library); if [[ $output ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$output"; false; fi; - - output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 tests); if [[ $output ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$output"; false; fi; - - output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 bin); if [[ $output ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$output"; false; fi; + - ./bin/travis-build.sh notifications: irc: "irc.freenode.org#zftalk.dev" diff --git a/bin/travis-build.sh b/bin/travis-build.sh new file mode 100755 index 00000000000..9d5d36b96bc --- /dev/null +++ b/bin/travis-build.sh @@ -0,0 +1,22 @@ +#!/bin/bash +cd "$(dirname $(dirname "$0"))" +php ./tests/run-tests.php +testresults=$? +cslibrary=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 library); if [[ $cslibrary ]];then while read -r line;do echo -e "\e[00;31m$line\e[00m"; done <<< "$cslibrary"; false; fi; +cstests=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 tests); if [[ $cstests ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$cstests"; false; fi; +csbin=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 bin); if [[ $csbin ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$csbin"; false; fi; + +if [[ "$testresults" ]]; then + exit 1 ; +fi +if [[ "$cslibrary" ]]; then + exit 1 ; +fi +if [[ "$cstests" ]]; then + exit 1 ; +fi +if [[ "$csbin" ]]; then + exit 1 ; +fi + +exit 0