| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- language: php
- dist: xenial
- php:
- - 5.6
- - 7.4
- env:
- matrix:
- - DB=sqlite db_dsn='sqlite:///:memory:'
- - 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"'
- - DB=pgsql db_dsn='postgres://postgres@127.0.0.1/cakephp_test'
- global:
- - DEFAULT=1
- - CODECOVERAGE=0
- - CHECKS=0
- services:
- - memcached
- - redis-server
- - postgresql
- - mysql
- cache:
- directories:
- - vendor
- - $HOME/.composer/cache
- matrix:
- fast_finish: true
- include:
- - php: 5.6
- env: PREFER_LOWEST=1
- - php: 7.3
- env: CHECKS=1 DEFAULT=0
- - php: 7.3
- env: CODECOVERAGE=1 DEFAULT=0
- before_install:
- - echo cakephp version && tail -1 VERSION.txt
- - phpenv config-rm xdebug.ini
- - if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE cakephp_test;'; fi
- - if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE cakephp_test2;'; fi
- - if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE cakephp_test3;'; fi
- - if [ $DB = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
- - if [ $DB = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi
- - if [ $DB = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi
- - pecl channel-update pecl.php.net
- - if [[ $CODECOVERAGE == 1 ]]; then pecl install pcov; fi
- - |
- if [[ ${TRAVIS_PHP_VERSION} != "5.6" ]]; then
- echo 'extension = memcached.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;
- fi
- - echo 'extension = redis.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - echo 'extension = apcu.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - echo 'apc.enable_cli = 1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]] ; then echo "yes" | pecl install channel://pecl.php.net/apcu-5.1.17 || true; fi
- - if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" ]] ; then echo "yes" | pecl install apcu-4.0.11 || true; fi
- - |
- if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" && $DB = 'mysql' ]]; then
- wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/xcache/3.2.0-1build1/xcache_3.2.0.orig.tar.gz
- tar xf xcache_3.2.0.orig.tar.gz
- pushd xcache-3.2.0
- phpize; ./configure
- make
- NO_INTERACTION=1 make test
- make install
- popd
- printf "extension=xcache.so\nxcache.size=64M\nxcache.var_size=16M\nxcache.test=On" > ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- fi
- - sudo locale-gen da_DK
- - sudo locale-gen de_DE
- before_script:
- - if [[ $CODECOVERAGE == 1 ]]; then composer require --dev pcov/clobber; fi
- - if [[ $CODECOVERAGE == 0 && $PREFER_LOWEST != 1 ]]; then composer install --no-interaction; fi
- - if [[ $PREFER_LOWEST == 1 ]]; then composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction; fi
- - if [[ $PREFER_LOWEST == 1 ]]; then composer require --dev dereuromark/composer-prefer-lowest; fi
- script:
- - if [[ $DEFAULT == 1 ]]; then vendor/bin/phpunit; fi
- - if [[ $PREFER_LOWEST == 1 ]]; then vendor/bin/validate-prefer-lowest; fi
- - if [[ $CODECOVERAGE == 1 ]]; then vendor/bin/pcov clobber; vendor/bin/phpunit --coverage-clover=clover.xml; fi
- - if [[ $CHECKS == 1 ]]; then composer phpstan-setup && composer phpstan; fi
- - if [[ $CHECKS == 1 ]]; then composer cs-check; fi
- after_success:
- - if [[ $CODECOVERAGE == 1 ]]; then bash <(curl -s https://codecov.io/bash); fi
- notifications:
- email: false
|