Skip to content

Commit

Permalink
Update .travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sizuhiko authored Feb 26, 2020
1 parent e4ade30 commit 41961d5
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,44 @@ php:
- 7.1
- 7.2

sudo: false

env:
- DB=mysql db_dsn='mysql://travis@0.0.0.0/cakephp_test'
- DB=pgsql db_dsn='postgres://travis@127.0.0.1/cakephp_test'
matrix:
- DB=mysql db_dsn='mysql://travis@0.0.0.0/cakephp_test'
- DB=pgsql db_dsn='postgres://travis@127.0.0.1/cakephp_test'

global:
- DEFAULT=1

matrix:
fast_finish: true
include:
- php: 5.6
env:
- COVERALLS=1
- php: 5.6
- php: 7.0
env:
- PHPCS=1
- php: 5.6
- PHPCS=1 DEFAULT=0
- php: 7.0
env:
- FOC_VALIDATE=1
- CODECOVERAGE=1 DEFAULT=0 DB=mysql db_dsn='mysql://travis@0.0.0.0/cakephp_test'

install:
before_script:
- composer self-update
- composer install --prefer-source --no-interaction --dev

before_script:
- sh -c "if [ '$PHPCS' = '1' ]; then composer require squizlabs/php_codesniffer; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test; GRANT ALL PRIVILEGES ON cakephp_test.* TO travis@localhost;'; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"

- sh -c "if [ '$COVERALLS' = '1' ]; then composer require --dev satooshi/php-coveralls:"^1.0"; fi"
- sh -c "if [ '$COVERALLS' = '1' ]; then mkdir -p build/logs; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then composer require 'cakephp/cakephp-codesniffer:@stable'; fi"
- sh -c "if [ '$COVERALLS' = '1' ]; then composer require --dev 'satooshi/php-coveralls:^2.0'; 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"
- phpenv rehash
- set +H
- cp phpunit.xml.dist phpunit.xml
- sh -c "if [ '$COVERALLS' = '1' ]; then mkdir -p build/logs; fi"

script:
- sh -c "if [ '$PHPCS' != '1' ]; then ./vendor/bin/phpunit; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then ./vendor/bin/phpcs -p --extensions=php --standard=psr2 --ignore=tests/bootstrap.php ./src ; fi"
- sh -c "if [ '$COVERALLS' = '1' ]; then ./vendor/bin/phpunit --stderr --coverage-clover build/logs/clover.xml; fi"

after_script:
- sh -c "if [ '$COVERALLS' = '1' ]; then php vendor/bin/coveralls -c .coveralls.yml -v; fi"
- sh -c "if [ '$DEFAULT' = '1' ]; then ./vendor/bin/phpunit --stderr; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then ./vendor/bin/phpcs -p -n --extensions=php --standard=psr2 --ignore=tests/bootstrap.php ./src ; fi"
- sh -c "if [ '$CODECOVERAGE' = '1' ]; then 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"

notifications:
email: false

0 comments on commit 41961d5

Please sign in to comment.