diff --git a/.travis.yml b/.travis.yml index 937ee26..6fb2cd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,11 +6,9 @@ php: - 7.1 - 7.2 -sudo: false - env: matrix: - - DB=mysql db_dsn='mysql://travis@0.0.0.0/cakephp_test' + - DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test' - DB=pgsql db_dsn='postgres://postgres@127.0.0.1/cakephp_test' - DB=sqlite db_dsn='sqlite:///:memory:' @@ -21,37 +19,36 @@ matrix: fast_finish: true include: - - php: 7.0 + - php: 7.1 env: PHPCS=1 DEFAULT=0 - - php: 7.0 - env: CODECOVERAGE=1 DEFAULT=0 DB=mysql db_dsn='mysql://travis@0.0.0.0/cakephp_test' + - php: 7.1 + env: PHPSTAN=1 DEFAULT=0 - php: 5.6 env: PREFER_LOWEST=1 before_script: - - phpenv config-rm xdebug.ini - - - composer self-update - - composer install --prefer-dist --no-interaction + - if [[ $TRAVIS_PHP_VERSION != 7.0 ]]; then phpenv config-rm xdebug.ini; fi - if [[ $PREFER_LOWEST != 1 ]]; then composer update --no-interaction ; fi - if [[ $PREFER_LOWEST == 1 ]]; then composer update --no-interaction --prefer-lowest ; fi - - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi" - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi" + - if [[ $DB = 'mysql' ]]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi + - if [[ $DB = 'pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi - - sh -c "if [ '$PHPCS' = '1' ]; then composer require cakephp/cakephp-codesniffer; fi" + - if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer; fi + - if [[ $PHPSTAN = 1 ]]; then composer require phpstan/phpstan; fi script: - - sh -c "if [ '$DEFAULT' = '1' ]; then vendor/bin/phpunit; fi" + - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.0 ]]; then vendor/bin/phpunit; fi + - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.0 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml; fi - - sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi" + - if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi + - if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -l 5 src; fi - - sh -c "if [ '$CODECOVERAGE' = '1' ]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml || true; fi" - - sh -c "if [ '$CODECOVERAGE' = '1' ]; then wget -O codecov.sh https://codecov.io/bash; fi" - - sh -c "if [ '$CODECOVERAGE' = '1' ]; then bash codecov.sh; fi" +after_success: + - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.0 ]]; then bash <(curl -s https://codecov.io/bash); fi notifications: - email: false \ No newline at end of file + email: false