.travis.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. language: php
  2. sudo: false
  3. php:
  4. - 5.5
  5. - 5.6
  6. - 7.0
  7. env:
  8. matrix:
  9. - 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=''
  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. - composer require yangqi/htmldom:dev-master
  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 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 --ignore=docs --ignore=test_files . ; fi"
  33. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then 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