Skip to content

Commit

Permalink
Updated config for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
rochamarcelo committed May 7, 2020
1 parent 93a3c13 commit c23578a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
language: php

dist: xenial

php:
- 7.2
- 7.3

sudo: false

services:
- postgresql
- mysql

cache:
directories:
- vendor
- $HOME/.composer/cache

env:
matrix:
- DB=mysql db_dsn='mysql://[email protected]/cakephp_test'
- 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"'
- DB=pgsql db_dsn='postgres://[email protected]/cakephp_test'
- DB=sqlite db_dsn='sqlite:///:memory:'

Expand All @@ -31,10 +42,10 @@ matrix:
before_script:
- if [[ $TRAVIS_PHP_VERSION != 7.3 ]]; then phpenv config-rm xdebug.ini; fi
- composer install --prefer-dist --no-interaction
- if [ $DB = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi
- if [ $DB = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
- if [[ $DB == 'mysql' ]]; then mysql -u root -e 'CREATE DATABASE cakephp_test;'; fi
- if [[ $DB == 'pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
- if [[ $PHPSTAN = 1 ]]; then composer stan-setup; fi

script:
- if [[ $DEFAULT = 1 ]]; then composer test; fi
- if [[ $COVERAGE = 1 ]]; then composer coverage-test; fi
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"test": "phpunit --stderr",
"stan": "phpstan analyse src/ && psalm --show-info=false",
"psalm": "psalm --show-info=false",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.11 vimeo/psalm:^3.0 && mv composer.backup composer.json",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12.7 psalm/phar:~3.8.0 && mv composer.backup composer.json",
"rector-setup": "cp composer.json composer.backup && composer require --dev rector/rector:^0.4.11 && mv composer.backup composer.json",
"coverage-test": "phpunit --stderr --coverage-clover=clover.xml"
}
Expand Down

0 comments on commit c23578a

Please sign in to comment.