forked from rectorphp/rector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
97 lines (81 loc) · 2.81 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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
allow_failures:
- php: '7.1'
env: CODING_STANDARD=true
- php: '7.2'
env: STANDALONE=true
- php: '7.3'
env: DOG_FOOD=true
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 --level symfony40 --dry-run
composer docs
fi
# eat your own dog fodd
- |
if [[ $DOG_FOOD == true ]]; then
bin/rector process src packages --level dead-code --dry-run
bin/rector process src packages --level 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 --level 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