@@ -2,24 +2,25 @@ language: php
22
33php :
44 - 7.2
5- - 7.3
65 - 7.4
76
8- dist : xenial
7+ services :
8+ - postgresql
9+ - mysql
910
1011env :
1112 global :
1213 - DEFAULT=1
13-
14- services :
15- - mysql
16- - postgresql
14+ matrix :
15+ - DB=mysql DB_DSN='mysql://[email protected] /cakephp_test?init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"' 16+ - DB=pgsql DB_DSN='postgres://[email protected] /cakephp_test' 17+ - DB=sqlite DB_DSN='sqlite:///:memory:'
1718
1819matrix :
1920 fast_finish : true
2021
2122 include :
22- - php : 7.2
23+ - php : 7.4
2324 env : PHPCS=1 DEFAULT=0
2425
2526 - php : 7.2
@@ -28,24 +29,32 @@ matrix:
2829 - php : 7.2
2930 env : PREFER_LOWEST=1 DEFAULT=0
3031
31- before_script :
32- - if [[ $TRAVIS_PHP_VERSION != 7.3 ]]; then phpenv config-rm xdebug.ini; fi
32+ before_install :
33+ - if [[ $DB == 'mysql' ]]; then mysql -u root -e 'CREATE DATABASE cakephp_test;'; fi
34+ - if [[ $DB == 'pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
35+
36+ install :
37+ - if [[ $DB != 'mysql' && $TRAVIS_PHP_VERSION != 7.4 ]]; then phpenv config-rm xdebug.ini; fi
3338
34- - if [[ $STATIC_ANALYSIS == 1 ]]; then composer require --dev phpstan/phpstan:^0.12 psalm/phar:^3.7; fi
35- - if [[ $PREFER_LOWEST == 1 ]]; then composer update --no-interaction --prefer-lowest --prefer-stable --prefer-dist; fi
36- - if [[ $PREFER_LOWEST != 1 ]]; then composer install --no-interaction; fi
39+ - if [[ $STATIC_ANALYSIS != 1 ]]; then composer install --no-interaction; fi
40+ - |
41+ if [[ $STATIC_ANALYSIS == 1 ]]; then
42+ composer require phpstan/phpstan:^0.12
43+ composer require psalm/phar:^3.7
44+ composer install --no-dev
45+ fi
3746
3847script :
39- - if [[ $TRAVIS_PHP_VERSION == 7.3 ]]; then ./vendor/bin/phpunit --coverage-clover=clover.xml; fi
40- - if [[ $DEFAULT == 1 || $PREFER_LOWEST == 1 ]]; then ./vendor/bin/phpunit; fi
48+ - if [[ $DB == 'mysql' && $ TRAVIS_PHP_VERSION == 7.4 ]]; then ./vendor/bin/phpunit --coverage-clover=clover.xml; fi
49+ - if [[ $DEFAULT == 1 ]]; then ./vendor/bin/phpunit; fi
4150
4251 - if [[ $PHPCS == 1 ]]; then ./vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi
4352
44- - if [[ $STATIC_ANALYSIS == 1 ]]; then vendor/bin/phpstan.phar analyse src; fi
45- - if [[ $STATIC_ANALYSIS == 1 ]]; then vendor/bin/psalm.phar analyse src ; fi
53+ - if [[ $STATIC_ANALYSIS == 1 ]]; then vendor/bin/phpstan analyse src; fi
54+ - if [[ $STATIC_ANALYSIS == 1 ]]; then vendor/bin/psalm.phar; fi
4655
4756after_success :
48- - if [[ $TRAVIS_PHP_VERSION == 7.3 ]]; then bash <(curl -s https://codecov.io/bash); fi
57+ - if [[ $DB == 'mysql' && $ TRAVIS_PHP_VERSION == 7.4 ]]; then bash <(curl -s https://codecov.io/bash); fi
4958
5059notifications :
5160 email : false
0 commit comments