rector/.travis.yml

101 lines
2.9 KiB
YAML
Raw Normal View History

2017-07-15 19:12:04 +02:00
language: php
matrix:
2019-05-19 10:44:14 +02:00
fast_finish: true
2018-11-04 22:12:47 +01:00
include:
2019-04-29 06:13:36 +02:00
- php: '7.1'
2018-11-04 22:12:47 +01:00
env: STATIC_ANALYSIS=true RUN_RECTOR=true
2019-04-29 06:13:36 +02:00
- php: '7.1'
2018-11-04 22:12:47 +01:00
env: COMPOSER_FLAGS="--prefer-lowest"
2019-04-29 06:13:36 +02:00
- php: '7.1'
env: CODING_STANDARD=true
2019-04-29 06:13:36 +02:00
- php: '7.2'
2018-11-04 22:12:47 +01:00
env: STANDALONE=true
2019-04-29 06:13:36 +02:00
- php: '7.3'
env: COVERAGE=true
2019-04-29 06:13:36 +02:00
- php: '7.3'
2019-03-31 21:55:38 +02:00
env: DOG_FOOD=true
2019-06-14 15:16:40 +02:00
- php: '7.4snapshot'
2018-11-04 23:58:54 +01:00
allow_failures:
2019-10-05 10:29:42 +02:00
# remove coding standard burden from contributors and fix once upon a time
2019-04-29 06:13:36 +02:00
- php: '7.1'
env: CODING_STANDARD=true
2019-04-29 06:13:36 +02:00
- php: '7.2'
2018-11-04 23:58:54 +01:00
env: STANDALONE=true
2019-04-29 13:14:25 +02:00
- php: '7.3'
env: DOG_FOOD=true
2019-07-14 14:47:42 +02:00
- php: '7.4snapshot'
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
2019-02-28 22:50:53 +01:00
# increase memory for tests
- echo "memory_limit=2048M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# report inline scripts fails
- set -e
2017-07-15 19:12:04 +02:00
script:
2019-10-05 10:29:42 +02:00
- vendor/bin/phpunit --testsuite main
2018-10-28 18:02:30 +01:00
- if [[ $STATIC_ANALYSIS == true ]]; then composer phpstan; fi
- if [[ $CODING_STANDARD == true ]]; then composer check-cs; fi
2018-11-04 22:12:47 +01:00
# Rector demo run
- |
2019-10-05 10:29:42 +02:00
if [[ $STATIC_ANALYSIS == true ]]; then
2019-02-04 04:29:46 +01:00
composer docs
2019-09-13 09:01:27 +02:00
php bin/check_services_in_yaml_configs.php
2019-09-26 12:48:28 +02:00
php bin/run_all_sets.php
2018-11-04 22:12:47 +01:00
fi
2017-10-29 23:26:15 +01:00
2019-07-14 12:15:00 +02:00
# Eat your own dog food
2019-03-31 21:55:38 +02:00
- |
if [[ $DOG_FOOD == true ]]; then
2019-10-05 10:29:42 +02:00
bin/rector process src --set dead-code --dry-run
2019-03-31 21:55:38 +02:00
fi
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
2019-05-07 13:43:26 +02:00
# missing in laravel for some reason
composer require doctrine/dbal -d laravel-dir
2018-11-04 22:12:47 +01:00
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 --set code-quality --hide-autoload-errors --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