.travis.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. language: php
  2. sudo: false
  3. php:
  4. - 5.4
  5. - 5.5
  6. - 5.6
  7. - 7.0
  8. env:
  9. matrix:
  10. - 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=''
  11. - 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=''
  12. - DB=sqlite db_class='Cake\Database\Driver\Sqlite' db_dsn='sqlite::memory:'
  13. global:
  14. - DEFAULT=1
  15. matrix:
  16. fast_finish: true
  17. include:
  18. - php: 7.0
  19. env: PHPCS=1 DEFAULT=0
  20. - php: 7.0
  21. env: CODECOVERAGE=1 DEFAULT=0
  22. allow_failures:
  23. - 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=''
  24. before_script:
  25. - composer self-update
  26. - composer install --prefer-dist --no-interaction
  27. - composer require yangqi/htmldom:dev-master
  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 [ '$COVERALLS' = '1' ]; then composer require --dev satooshi/php-coveralls:dev-master; fi"
  31. - sh -c "if [ '$COVERALLS' = '1' ]; then mkdir -p build/logs; fi"
  32. - phpenv rehash
  33. - set +H
  34. - cp phpunit.xml.dist phpunit.xml
  35. script:
  36. - sh -c "if [ '$DEFAULT' = '1' ]; then phpunit; fi"
  37. - 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 . ; fi"
  38. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then phpunit --coverage-clover=clover.xml || true; fi"
  39. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then wget -O codecov.sh https://codecov.io/bash; fi"
  40. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then bash codecov.sh; fi"
  41. notifications:
  42. email: false