-
Notifications
You must be signed in to change notification settings - Fork 26
/
.travis.yml
50 lines (44 loc) · 1.94 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
language: php
php:
- 7.2
- 7.3
- 7.4
- 8.0
cache:
directories:
- vendor
- $HOME/.composer/cache
env:
global:
- PREFER_LOWEST="--prefer-lowest" TEST=1 CODECOV=0 STAN=0
matrix:
include:
- php: 8.0
env: PREFER_LOWEST="" TEST=1 CODECOV=1 STAN=0
- php: 8.0
env: PREFER_LOWEST="" TEST=0 CODECOV=0 STAN=1
before_script:
- phpenv config-rm xdebug.ini
- echo "assert.exception = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- if [[ $TRAVIS_PHP_VERSION = 7.2 ]]; then composer remove --dev phpspec/prophecy-phpunit; fi
- composer update --prefer-dist --no-interaction $PREFER_LOWEST
- composer show -i
# @see https://github.com/cakephp/cakephp/pull/13567#issuecomment-525844184
# And for old prophecy(in prefer-lowest build)
- |
if [[ $TRAVIS_PHP_VERSION = 7.4 ]]; then
sed -i 's/(string) $parameter->getType()/$parameter->getType()->getName()/g' vendor/phpunit/phpunit-mock-objects/src/Generator.php
sed -i 's/(string) $method->getReturnType()/$method->getReturnType()->getName()/g' vendor/phpunit/phpunit-mock-objects/src/Generator.php
sed -i 's/(string) $parameter->getType()/$parameter->getType()->getName()/g' vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php
sed -i 's/(string) $method->getReturnType()/$method->getReturnType()->getName()/g' vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php
sed -i 's/(string) $reflectedMethod->getReturnType()/$reflectedMethod->getReturnType()->getName()/g' vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php
fi
script:
- if [[ $TEST = 1 && $CODECOV = 0 ]]; then vendor/bin/phpunit; fi
- if [[ $TEST = 1 && $CODECOV = 1 ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml; fi
- |
if [[ $STAN = 1 ]]; then
vendor/bin/phpstan analyse
fi
after_success:
- if [[ $TEST = 1 && $CODECOV = 1 ]]; then bash <(curl -s https://codecov.io/bash); fi