.travis.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. language: php
  2. php:
  3. - 7.0
  4. - 5.6
  5. - 7.2
  6. - 7.3
  7. dist: trusty
  8. env:
  9. matrix:
  10. - DB=sqlite db_dsn='sqlite:///:memory:'
  11. - DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test?init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'
  12. - DB=pgsql db_dsn='postgres://postgres@127.0.0.1/cakephp_test'
  13. global:
  14. - DEFAULT=1
  15. - CODECOVERAGE=0
  16. - CHECKS=0
  17. services:
  18. - memcached
  19. - redis-server
  20. - postgresql
  21. - mysql
  22. addons:
  23. postgresql: "9.4"
  24. cache:
  25. directories:
  26. - vendor
  27. - $HOME/.composer/cache
  28. matrix:
  29. fast_finish: true
  30. include:
  31. - php: 5.6
  32. env: PREFER_LOWEST=1
  33. - php: 7.2
  34. env: CHECKS=1 DEFAULT=0
  35. - php: 7.1
  36. env: CODECOVERAGE=1 DEFAULT=0
  37. before_install:
  38. - echo cakephp version && tail -1 VERSION.txt
  39. - phpenv config-rm xdebug.ini
  40. - if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE cakephp_test;'; fi
  41. - if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE cakephp_test2;'; fi
  42. - if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE cakephp_test3;'; fi
  43. - if [ $DB = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
  44. - if [ $DB = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi
  45. - if [ $DB = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi
  46. - pecl channel-update pecl.php.net
  47. - |
  48. if [[ ${TRAVIS_PHP_VERSION} != "5.6" ]]; then
  49. echo 'extension = memcached.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;
  50. fi
  51. - echo 'extension = redis.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  52. - echo 'extension = apcu.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  53. - echo 'apc.enable_cli = 1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  54. - if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]] ; then echo "yes" | pecl install channel://pecl.php.net/apcu-5.1.5 || true; fi
  55. - if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" ]] ; then echo "yes" | pecl install apcu-4.0.11 || true; fi
  56. - |
  57. if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" && $DB = 'mysql' ]]; then
  58. wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz
  59. tar xf xcache-3.2.0.tar.gz
  60. pushd xcache-3.2.0
  61. phpize; ./configure
  62. make
  63. NO_INTERACTION=1 make test
  64. make install
  65. popd
  66. printf "extension=xcache.so\nxcache.size=64M\nxcache.var_size=16M\nxcache.test=On" > ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  67. fi
  68. - sudo locale-gen da_DK
  69. before_script:
  70. - if [[ $PREFER_LOWEST != 1 ]]; then composer install --prefer-source --no-interaction; fi
  71. - if [[ $PREFER_LOWEST == 1 ]]; then composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction; fi
  72. - if [[ $PREFER_LOWEST == 1 ]]; then composer require --dev dereuromark/composer-prefer-lowest; fi
  73. script:
  74. - if [[ $DEFAULT == 1 ]]; then vendor/bin/phpunit; fi
  75. - if [[ $PREFER_LOWEST == 1 ]]; then vendor/bin/validate-prefer-lowest; fi
  76. - if [[ $CODECOVERAGE == 1 ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml; fi
  77. - if [[ $CHECKS == 1 ]]; then composer require --dev phpstan/phpstan:^0.11 && vendor/bin/phpstan analyse -c phpstan.neon -l 2 src/; fi
  78. - if [[ $CHECKS == 1 ]]; then composer cs-check; fi
  79. after_success:
  80. - if [[ $CODECOVERAGE == 1 ]]; then bash <(curl -s https://codecov.io/bash); fi
  81. notifications:
  82. email: false