1
0
mirror of synced 2025-02-09 00:39:25 +03:00
doctrine2/.travis.yml
Luís Cobucci e07c90df44
Add PHPBench to Travis-CI matrix
Also separating the execution of the tests from other tools.
2017-07-23 10:30:19 +02:00

76 lines
2.5 KiB
YAML

dist: trusty
sudo: false
language: php
php:
- 7.1
- nightly
env:
- DB=mysql
- DB=pgsql
- DB=sqlite
before_script:
- if [[ $TRAVIS_PHP_VERSION = '7.1' && $DB = 'sqlite' && "$DEPENDENCIES" != "low" ]]; then PHPUNIT_FLAGS="--coverage-clover ./build/logs/clover.xml"; else PHPUNIT_FLAGS=""; fi
- if [[ "$PHPUNIT_FLAGS" == "" ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
- if [[ $PHPSTAN = 1 ]]; then echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
- composer self-update
- composer install --prefer-source
- if [ "$DEPENDENCIES" != "low" ]; then composer update; fi;
- if [ "$DEPENDENCIES" == "low" ]; then composer update --prefer-lowest; fi;
- if [[ $PHPSTAN = 1 ]]; then composer require --dev --prefer-stable phpstan/phpstan:^0.7 symfony/console:^3.0; fi
- if [ "$MYSQL_VERSION" == "5.7" ]; then bash ./tests/travis/install-mysql-5.7.sh; fi;
- if [[ $DB == "mysql" || $DB == "mariadb" ]]; then mysql -e "CREATE SCHEMA doctrine_tests; GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'"; fi;
- if [[ $PHPBENCH = 1 ]]; then wget https://phpbench.github.io/phpbench/phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar.pubkey; fi
script:
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -l 1 -c phpstan.neon lib; fi
- if [[ $PHPBENCH = 1 ]]; then php phpbench.phar run -l dots --report=default; fi
- if [[ $DB != "none" ]]; then ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml $PHPUNIT_FLAGS; fi
- if [[ $DB != "none" ]]; then ENABLE_SECOND_LEVEL_CACHE=1 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --exclude-group performance,non-cacheable,locking_functional; fi
after_script:
- if [[ "$PHPUNIT_FLAGS" != "" ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [[ "$PHPUNIT_FLAGS" != "" ]]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
matrix:
fast_finish: true
include:
- php: 7.1
env: DB=mariadb
addons:
mariadb: 10.1
- php: 7.1
env:
- DB=sqlite
- DEPENDENCIES='low'
- php: 7.1
env:
- DB=pgsql
- php: 7.1
env: DB=mysql MYSQL_VERSION=5.7
sudo: required
- php: nightly
env: DB=mysql MYSQL_VERSION=5.7
sudo: required
- php: 7.1
env:
- DB=none
- PHPSTAN=1
- php: 7.1
env:
- DB=none
- PHPBENCH=1
allow_failures:
- php: nightly
cache:
directories:
- $HOME/.composer/cache