.travis.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. allow_failures:
  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. before_script:
  24. - composer self-update
  25. - composer install --prefer-dist --no-interaction
  26. - composer require yangqi/htmldom:dev-master
  27. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  28. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
  29. - sh -c "if [ '$COVERALLS' = '1' ]; then composer require --dev satooshi/php-coveralls:dev-master; fi"
  30. - sh -c "if [ '$COVERALLS' = '1' ]; then mkdir -p build/logs; fi"
  31. - phpenv rehash
  32. - set +H
  33. - cp phpunit.xml.dist phpunit.xml
  34. script:
  35. - sh -c "if [ '$DEFAULT' = '1' ]; then phpunit; fi"
  36. - 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"
  37. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then phpunit --coverage-clover=clover.xml || true; fi"
  38. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then wget -O codecov.sh https://codecov.io/bash; fi"
  39. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then bash codecov.sh; fi"
  40. notifications:
  41. email: false