.travis.yml 3.6 KB

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