1
0
mirror of synced 2025-02-02 21:41:45 +03:00

Travis enhancements: Use Build Stages, added PHP 7.2

This commit is contained in:
Michael Moravec 2017-07-25 02:45:50 +02:00
parent 84079572f7
commit dbb0cdea51
No known key found for this signature in database
GPG Key ID: 2930160BB3C7CFE4
2 changed files with 55 additions and 44 deletions

View File

@ -4,68 +4,79 @@ language: php
php: php:
- 7.1 - 7.1
- 7.2
- nightly - nightly
env: env:
- DB=sqlite
- DB=mysql - DB=mysql
- DB=pgsql - DB=pgsql
- DB=sqlite
before_script: before_install:
- if [[ $TRAVIS_PHP_VERSION = '7.1' && $DB = 'sqlite' && "$DEPENDENCIES" != "low" ]]; then PHPUNIT_FLAGS="--coverage-clover ./build/logs/clover.xml"; else PHPUNIT_FLAGS=""; fi - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
- 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 self-update
- composer install --prefer-source
- if [ "$DEPENDENCIES" != "low" ]; then composer update; fi; install: travis_retry composer update --prefer-dist
- 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: script:
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -l 1 -c phpstan.neon lib; 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 php phpbench.phar run -l dots --report=default; fi - ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml
- if [[ $DB != "none" ]]; then ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml $PHPUNIT_FLAGS; fi - ENABLE_SECOND_LEVEL_CACHE=1 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --exclude-group performance,non-cacheable,locking_functional
- 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: jobs:
- 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: include:
- php: 7.1 - stage: Test
env: DB=mariadb env: DB=mariadb
addons: addons:
mariadb: 10.1 mariadb: 10.1
- php: 7.1 - stage: Test
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 env: DB=mysql MYSQL_VERSION=5.7
php: 7.1
before_script:
- ./tests/travis/install-mysql-$MYSQL_VERSION.sh
sudo: required sudo: required
- php: 7.1 - stage: Test
env: env: DB=mysql MYSQL_VERSION=5.7
- DB=none php: 7.2
- PHPSTAN=1 before_script:
- php: 7.1 - ./tests/travis/install-mysql-$MYSQL_VERSION.sh
env: sudo: required
- DB=none
- PHPBENCH=1 - stage: Test
env: DB=mysql MYSQL_VERSION=5.7
php: nightly
before_script:
- ./tests/travis/install-mysql-$MYSQL_VERSION.sh
sudo: required
- stage: Test
env: DB=sqlite DEPENDENCIES=low
install: travis_retry composer update --prefer-dist --prefer-lowest
- stage: Lint
env: DB=none
before_script:
- echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- travis_retry composer require --dev --prefer-dist --prefer-stable phpstan/phpstan:^0.7 symfony/console:^3.0
script: vendor/bin/phpstan analyse -l 1 -c phpstan.neon lib
- stage: Coverage
env: DB=sqlite
before_script:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
script:
- ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --coverage-clover ./build/logs/clover.xml
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
- stage: Benchmark
env: DB=none
before_script: wget https://phpbench.github.io/phpbench/phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar.pubkey
script: php phpbench.phar run -l dots --report=default
allow_failures: allow_failures:
- php: nightly - php: nightly

0
tests/travis/install-mysql-5.7.sh Normal file → Executable file
View File