.travis.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. language: php
  2. sudo: false
  3. php:
  4. - 5.6
  5. - 7.0
  6. - 7.1
  7. env:
  8. matrix:
  9. - DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test'
  10. - 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=''
  11. - DB=sqlite db_class='Cake\Database\Driver\Sqlite' db_dsn='sqlite::memory:'
  12. global:
  13. - DEFAULT=1
  14. matrix:
  15. fast_finish: true
  16. include:
  17. - php: 7.0
  18. env: PHPCS=1 DEFAULT=0
  19. - php: 7.0
  20. env: CODECOVERAGE=1 DEFAULT=0
  21. before_script:
  22. - composer self-update
  23. - composer install --prefer-dist --no-interaction
  24. - if [[ $PHPCS != 1 ]]; then composer require phpunit/phpunit:"^5.7|^6.0"; fi
  25. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  26. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
  27. - phpenv rehash
  28. - set +H
  29. - cp phpunit.xml.dist phpunit.xml
  30. script:
  31. - sh -c "if [ '$DEFAULT' = '1' ]; then vendor/bin/phpunit; fi"
  32. - sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=/vendor,/docs/,test_files/ . ; fi"
  33. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then vendor/bin/phpunit --coverage-clover=clover.xml || true; fi"
  34. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then wget -O codecov.sh https://codecov.io/bash; fi"
  35. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then bash codecov.sh; fi"
  36. notifications:
  37. email: false