.travis.yml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. language: php
  2. php:
  3. - 5.5
  4. - 5.6
  5. - 7.0
  6. sudo: false
  7. env:
  8. matrix:
  9. - DB=mysql db_dsn='mysql://travis@0.0.0.0/cakephp_test'
  10. - DB=pgsql db_dsn='postgres://postgres@127.0.0.1/cakephp_test'
  11. - DB=sqlite db_dsn='sqlite:///:memory:'
  12. global:
  13. - DEFAULT=1
  14. services:
  15. - memcached
  16. - redis-server
  17. - postgresql
  18. addons:
  19. postgresql: "9.4"
  20. cache:
  21. directories:
  22. - vendor
  23. - $HOME/.composer/cache
  24. matrix:
  25. fast_finish: true
  26. include:
  27. - php: 7.0
  28. env: CODECOVERAGE=1 DEFAULT=0
  29. - php: 7.0
  30. env: PHPCS=1 DEFAULT=0
  31. - php: hhvm
  32. env: HHVM=1 DB=sqlite db_dsn='sqlite:///:memory:'
  33. - php: hhvm
  34. env: HHVM=1 DB=mysql db_dsn='mysql://travis@0.0.0.0/cakephp_test'
  35. allow_failures:
  36. - env: CODECOVERAGE=1 DEFAULT=0
  37. - php: hhvm
  38. before_install:
  39. - sh -c "if [ '$HHVM' != '1' ]; then phpenv config-rm xdebug.ini; fi"
  40. - composer self-update
  41. - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;
  42. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  43. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi"
  44. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test3;'; fi"
  45. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
  46. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi"
  47. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi"
  48. - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]] ; then pecl channel-update pecl.php.net; fi;
  49. - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]] ; then echo 'extension = memcached.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
  50. - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]] ; then echo 'extension = redis.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
  51. - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]] ; then echo 'extension = apcu.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
  52. - if [[ $TRAVIS_PHP_VERSION =~ 5.[56] ]] ; then echo yes | pecl install apcu-4.0.10; fi
  53. - if [[ $TRAVIS_PHP_VERSION = 7.* ]] ; then echo yes | pecl install apcu; fi
  54. - if [[ $TRAVIS_PHP_VERSION = 7.* ]] ; then pecl config-set preferred_state beta; echo yes | pecl install apcu_bc; fi
  55. - if [[ $TRAVIS_PHP_VERSION = 'hhvm' ]] ; then composer require lorenzo/multiple-iterator=~1.0; fi
  56. - phpenv rehash
  57. - set +H
  58. before_script:
  59. - composer install --prefer-dist --no-interaction
  60. script:
  61. - sh -c "if [ '$DEFAULT' = '1' ]; then vendor/bin/phpunit; fi"
  62. - sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi"
  63. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml || true; fi"
  64. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then wget -O codecov.sh https://codecov.io/bash; fi"
  65. - sh -c "if [ '$CODECOVERAGE' = '1' ]; then bash codecov.sh; fi"
  66. notifications:
  67. email: false