123 lines
4.0 KiB
YAML
123 lines
4.0 KiB
YAML
dist: trusty
|
|
sudo: false
|
|
language: php
|
|
|
|
php:
|
|
- 7.1
|
|
- 7.2
|
|
- 7.3
|
|
- nightly
|
|
|
|
env:
|
|
- DB=sqlite
|
|
- DB=mysql
|
|
- DB=pgsql
|
|
|
|
before_install:
|
|
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
|
|
- composer self-update
|
|
|
|
install: travis_retry composer update --prefer-dist
|
|
|
|
script:
|
|
- if [[ "$DB" == "mysql" || "$DB" == "mariadb" ]]; then mysql -e "CREATE SCHEMA doctrine_tests; GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'"; fi
|
|
- ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml
|
|
- ENABLE_SECOND_LEVEL_CACHE=1 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --exclude-group performance,non-cacheable,locking_functional
|
|
|
|
jobs:
|
|
include:
|
|
- stage: Test
|
|
env: DB=mariadb
|
|
addons:
|
|
mariadb: 10.1
|
|
|
|
- stage: Test
|
|
env: DB=mysql MYSQL_VERSION=5.7
|
|
php: 7.1
|
|
before_script:
|
|
- ./tests/travis/install-mysql-$MYSQL_VERSION.sh
|
|
sudo: required
|
|
|
|
- stage: Test
|
|
env: DB=mysql MYSQL_VERSION=5.7
|
|
php: 7.2
|
|
before_script:
|
|
- ./tests/travis/install-mysql-$MYSQL_VERSION.sh
|
|
sudo: required
|
|
|
|
- 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: Test
|
|
if: type = cron
|
|
php: 7.3
|
|
env: DB=sqlite DEV_DEPENDENCIES
|
|
install:
|
|
- composer config minimum-stability dev
|
|
- travis_retry composer update --prefer-dist
|
|
|
|
- stage: Test
|
|
env: DB=sqlite COVERAGE
|
|
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: Code Quality
|
|
env: DB=none STATIC_ANALYSIS
|
|
install: travis_retry composer install --prefer-dist
|
|
before_script:
|
|
- echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
|
- echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
|
- travis_retry composer require --dev --prefer-dist --prefer-stable phpstan/phpstan:^0.9
|
|
script: vendor/bin/phpstan analyse -l 1 -c phpstan.neon lib
|
|
|
|
- stage: Code Quality
|
|
env: DB=none BENCHMARK
|
|
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
|
|
|
|
- stage: Code Quality
|
|
if: NOT type = pull_request
|
|
env: DB=none CODING_STANDARDS
|
|
php: 7.1
|
|
install: travis_retry composer install --prefer-dist
|
|
script:
|
|
- ./vendor/bin/phpcs
|
|
|
|
- stage: Code Quality
|
|
if: type = pull_request
|
|
env: DB=none PULL_REQUEST_CODING_STANDARDS
|
|
php: 7.1
|
|
install: travis_retry composer install --prefer-dist
|
|
script:
|
|
- |
|
|
if [ $TRAVIS_BRANCH != "master" ]; then
|
|
git remote set-branches --add origin $TRAVIS_BRANCH;
|
|
git fetch origin $TRAVIS_BRANCH;
|
|
fi
|
|
- git merge-base origin/$TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_SHA || git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge --unshallow
|
|
- wget https://github.com/diff-sniffer/git/releases/download/0.2.0/git-phpcs.phar
|
|
- php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA
|
|
|
|
allow_failures:
|
|
- php: nightly
|
|
- stage: Code Quality
|
|
env: DB=none CODING_STANDARDS
|
|
|
|
cache:
|
|
directories:
|
|
- $HOME/.composer/cache
|