rector/.travis.yml

81 lines
2.2 KiB
YAML
Raw Normal View History

2017-07-15 19:12:04 +02:00
language: php
matrix:
2018-11-04 22:12:47 +01:00
include:
- php: 7.1
env: STATIC_ANALYSIS=true RUN_RECTOR=true
- php: 7.1
env: COMPOSER_FLAGS="--prefer-lowest"
- php: 7.2
env: COVERAGE=true
- php: 7.2
env: STANDALONE=true
- php: 7.3
env: COMPOSER_FLAGS="--ignore-platform-reqs"
2018-11-04 23:58:54 +01:00
allow_failures:
- php: 7.2
env: STANDALONE=true
2017-07-15 19:12:04 +02:00
install:
2018-11-04 22:12:47 +01:00
- composer update $COMPOSER_FLAGS
2017-07-15 19:12:04 +02:00
before_script:
2018-11-04 22:12:47 +01:00
# disable xdebug
- if [[ $COVERAGE == "" ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
2017-07-15 19:12:04 +02:00
script:
2018-11-04 22:12:47 +01:00
- vendor/bin/phpunit
2018-10-28 18:02:30 +01:00
2018-11-04 22:12:47 +01:00
- |
if [[ $STATIC_ANALYSIS == true ]]; then
composer check-cs
composer phpstan
fi
2018-11-04 22:12:47 +01:00
# Rector demo run
- |
if [[ $RUN_RECTOR == true ]]; then
bin/rector process src --level symfony40 --dry-run
bin/rector generate-rector-overview >> rector-overview.md
fi
2017-10-29 23:26:15 +01:00
2018-11-04 22:12:47 +01:00
# 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
2018-11-04 22:11:43 +01:00
2018-11-04 22:12:47 +01:00
mkdir rector-dir
composer require rector/rector -d rector-dir
2018-11-04 22:11:43 +01:00
2018-11-04 22:12:47 +01:00
mkdir laravel-dir
composer create-project laravel/framework laravel-dir
composer dump-autoload --no-dev -d laravel-dir
2018-11-04 22:11:43 +01:00
2018-11-04 22:12:47 +01:00
# 2. run an nother project
rector-dir/vendor/bin/rector
2018-11-04 22:11:43 +01:00
2018-11-04 22:12:47 +01:00
cd laravel-dir
../rector-dir/vendor/bin/rector
2018-11-04 22:11:43 +01:00
2018-11-04 22:39:48 +01:00
# --hide-autoload-errors due to skipped dev deps and mixes tests in /src
../rector-dir/vendor/bin/rector process src --level code-quality --hide-autoload-errors -vvv --dry-run
2018-11-04 22:12:47 +01:00
fi
2018-11-04 22:11:43 +01:00
2018-10-28 18:02:30 +01:00
after_script:
2018-11-04 22:12:47 +01:00
# 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
2018-10-28 18:02:30 +01:00
cache:
2018-11-04 22:12:47 +01:00
directories:
- $HOME/.composer/cache
2017-07-15 19:12:04 +02:00
notifications:
2018-11-04 22:12:47 +01:00
email: false