.travis.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. language: php
  2. php:
  3. - 5.4
  4. - 5.5
  5. - 5.6
  6. env:
  7. matrix:
  8. - DB=mysql db_class='Cake\Database\Driver\Mysql' db_dsn='mysql:host=0.0.0.0;dbname=cakephp_test' db_database='cakephp_test' db_username='travis' db_password=''
  9. - DB=pgsql db_class='Cake\Database\Driver\Postgres' db_dsn='pgsql:host=127.0.0.1;dbname=cakephp_test' db_database="cakephp_test" db_username='postgres' db_password=''
  10. - DB=sqlite db_class='Cake\Database\Driver\Sqlite' db_dsn='sqlite::memory:'
  11. global:
  12. - DEFAULT=1
  13. matrix:
  14. fast_finish: true
  15. include:
  16. - php: 5.4
  17. env: PHPCS=1 DEFAULT=0
  18. - php: 5.4
  19. env: COVERALLS=1 DEFAULT=0
  20. allow_failures:
  21. - env: DB=sqlite db_class='Cake\Database\Driver\Sqlite' db_dsn='sqlite::memory:'
  22. - env: DB=pgsql db_class='Cake\Database\Driver\Postgres' db_dsn='pgsql:host=127.0.0.1;dbname=cakephp_test' db_database="cakephp_test" db_username='postgres' db_password=''
  23. - php: 5.4
  24. env: PHPCS=1 DEFAULT=0
  25. before_script:
  26. - composer self-update
  27. - composer install --prefer-dist --no-interaction --dev
  28. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  29. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
  30. - sh -c "if [ '$PHPCS' = '1' ]; then pear channel-discover pear.cakephp.org; fi"
  31. - sh -c "if [ '$PHPCS' = '1' ]; then pear install --alldeps cakephp/CakePHP_CodeSniffer; fi"
  32. - sh -c "if [ '$COVERALLS' = '1' ]; then composer require --dev satooshi/php-coveralls:dev-master; fi"
  33. - sh -c "if [ '$COVERALLS' = '1' ]; then mkdir -p build/logs; fi"
  34. - phpenv rehash
  35. - set +H
  36. - cp phpunit.xml.dist phpunit.xml
  37. script:
  38. - sh -c "if [ '$COVERALLS' = '1' ]; then phpunit --coverage-clover build/logs/clover.xml; fi"
  39. - sh -c "if [ '$COVERALLS' = '1' ]; then php vendor/bin/coveralls -c .coveralls.yml -v; fi"
  40. - sh -c "if [ '$DEFAULT' = '1' ]; then phpunit; fi"
  41. - sh -c "if [ '$PHPCS' = '1' ]; then phpcs -p --extensions=php --standard=CakePHP --ignore=vendor --ignore=tests --ignore=docs . ; fi"
  42. notifications:
  43. email: false