.travis.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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_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. - if [[ $PHPCS != 1 ]]; then composer require phpunit/phpunit:"^5.7|^6.0"; fi
  26. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  27. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
  28. - phpenv rehash
  29. - set +H
  30. - cp phpunit.xml.dist phpunit.xml
  31. script:
  32. - sh -c "if [ '$DEFAULT' = '1' ]; then vendor/bin/phpunit; fi"
  33. - 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"
  34. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then vendor/bin/phpunit --coverage-clover=clover.xml || true; fi"
  35. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then wget -O codecov.sh https://codecov.io/bash; fi"
  36. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then bash codecov.sh; fi"
  37. notifications:
  38. email: false