mirror of
https://github.com/rectorphp/rector.git
synced 2024-09-06 15:41:59 +00:00
100 lines
2.9 KiB
YAML
100 lines
2.9 KiB
YAML
language: php
|
|
|
|
matrix:
|
|
fast_finish: true
|
|
include:
|
|
- php: '7.1'
|
|
env: STATIC_ANALYSIS=true RUN_RECTOR=true
|
|
- php: '7.1'
|
|
env: COMPOSER_FLAGS="--prefer-lowest"
|
|
- php: '7.1'
|
|
env: CODING_STANDARD=true
|
|
- php: '7.2'
|
|
env: STANDALONE=true
|
|
- php: '7.3'
|
|
env: COVERAGE=true
|
|
- php: '7.3'
|
|
env: DOG_FOOD=true
|
|
- php: '7.4snapshot'
|
|
allow_failures:
|
|
- php: '7.1'
|
|
env: CODING_STANDARD=true
|
|
- php: '7.2'
|
|
env: STANDALONE=true
|
|
- php: '7.3'
|
|
env: DOG_FOOD=true
|
|
- php: '7.4snapshot'
|
|
|
|
install:
|
|
- composer update $COMPOSER_FLAGS
|
|
|
|
before_script:
|
|
# disable xdebug
|
|
- if [[ $COVERAGE == "" ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
|
|
# increase memory for tests
|
|
- echo "memory_limit=2048M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
|
# report inline scripts fails
|
|
- set -e
|
|
|
|
script:
|
|
- vendor/bin/phpunit
|
|
|
|
- if [[ $STATIC_ANALYSIS == true ]]; then composer phpstan; fi
|
|
- if [[ $CODING_STANDARD == true ]]; then composer check-cs; fi
|
|
|
|
# Rector demo run
|
|
- |
|
|
if [[ $RUN_RECTOR == true ]]; then
|
|
bin/rector process src --set symfony40 --dry-run
|
|
composer docs
|
|
fi
|
|
|
|
# Eat your own dog food
|
|
- |
|
|
if [[ $DOG_FOOD == true ]]; then
|
|
bin/rector process src packages --set dead-code --dry-run
|
|
bin/rector process src packages --set code-quality --dry-run
|
|
fi
|
|
|
|
# Run standalone install in non-root package, ref https://github.com/rectorphp/rector/issues/732
|
|
- |
|
|
if [[ $STANDALONE == true ]]; then
|
|
# 1. install locally
|
|
mkdir test-paths
|
|
cd test-paths
|
|
|
|
mkdir rector-dir
|
|
composer require rector/rector -d rector-dir
|
|
|
|
mkdir laravel-dir
|
|
composer create-project laravel/framework laravel-dir
|
|
# missing in laravel for some reason
|
|
composer require doctrine/dbal -d laravel-dir
|
|
composer dump-autoload --no-dev -d laravel-dir
|
|
|
|
# 2. run an nother project
|
|
rector-dir/vendor/bin/rector
|
|
|
|
cd laravel-dir
|
|
../rector-dir/vendor/bin/rector
|
|
|
|
# --hide-autoload-errors due to skipped dev deps and mixes tests in /src
|
|
../rector-dir/vendor/bin/rector process src --set code-quality --hide-autoload-errors --dry-run
|
|
fi
|
|
|
|
after_script:
|
|
# Coverage
|
|
- |
|
|
if [[ $COVERAGE == true && $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then
|
|
vendor/bin/phpunit --coverage-clover coverage.xml
|
|
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
|
|
php php-coveralls.phar --verbose
|
|
fi
|
|
|
|
cache:
|
|
directories:
|
|
- $HOME/.composer/cache
|
|
|
|
notifications:
|
|
email: false
|