Skip to content

Commit 4eac73d

Browse files
mimmi20dblandin
authored andcommitted
update configuration for travis-ci
1 parent 863e099 commit 4eac73d

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

.travis.yml

+31-29
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@ language: php
22

33
sudo: false
44

5+
php:
6+
- 5.3
7+
- 5.4
8+
- 5.5
9+
- 5.6
10+
- 7.0
11+
- 7.1
12+
- nightly
13+
14+
os:
15+
- linux
16+
17+
env:
18+
- COMPOSER_FLAGS="--prefer-lowest"
19+
- COMPOSER_FLAGS=""
20+
521
matrix:
622
include:
723
- php: 5.3
8-
env: WITH_LOWEST=true
9-
- php: 5.3
10-
env: WITH_HIGHEST=true WITH_CS=true WITH_PHAR=true
11-
- php: 5.4
12-
env: WITH_LOWEST=true
13-
- php: 5.4
14-
env: WITH_HIGHEST=true
15-
- php: 5.5
16-
env: WITH_LOWEST=true
17-
- php: 5.5
18-
env: WITH_HIGHEST=true
19-
- php: 5.6
20-
env: WITH_LOWEST=true
21-
- php: 5.6
22-
env: WITH_HIGHEST=true
23-
- php: 7.0
24-
env: WITH_LOWEST=true
25-
- php: 7.0
26-
env: WITH_HIGHEST=true
24+
env: BUILD_PHAR=true
2725
- php: 7.1
28-
env: WITH_LOWEST=true
26+
env: COVERAGE=yes
2927
- php: 7.1
30-
env: WITH_HIGHEST=true WITH_COVERAGE=true
28+
env: EXECUTE_CS_CHECK=yes
29+
allow_failures:
30+
- php: nightly
3131

3232
cache:
3333
directories:
@@ -36,24 +36,26 @@ cache:
3636

3737
before_install:
3838
- source .travis/travis.sh
39-
- xdebug-disable
40-
- composer self-update
41-
- composer validate
39+
- if [[ $TRAVIS_PHP_VERSION != hhvm && $TRAVIS_PHP_VERSION != nightly && $COVERAGE != yes ]]; then phpenv config-rm xdebug.ini; fi
40+
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo 'opcache.enable=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
41+
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo 'opcache.enable_cli=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
42+
- travis_retry composer self-update
4243

4344
install:
44-
- if [[ "$WITH_LOWEST" == "true" ]]; then composer update --prefer-lowest --prefer-dist; else composer install --prefer-dist; fi
45+
- travis_retry composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction $COMPOSER_FLAGS
4546

4647
before_script:
4748
- git config --global user.email "[email protected]"
4849
- git config --global user.name "Travis CI"
4950
- mkdir -p "$HOME/.php-cs-fixer"
5051

5152
script:
52-
- if [[ "$WITH_CS" == "true" ]]; then vendor/bin/php-cs-fixer fix --config=.php_cs --verbose --diff --dry-run; fi
53-
- run-tests
53+
- composer validate
54+
- if [[ $COVERAGE == yes ]]; then vendor/bin/phpunit --coverage-clover=build/logs/clover.xml; else vendor/bin/phpunit --no-coverage; fi
55+
- if [[ $EXECUTE_CS_CHECK == yes ]]; then php -n -d memory_limit=768M vendor/bin/php-cs-fixer fix --config=.php_cs --verbose --diff --dry-run; fi
5456

5557
after_success:
56-
- if [[ "$WITH_COVERAGE" == "true" ]]; then php composer/bin/test-reporter; fi
58+
- if [[ $COVERAGE == yes ]]; then php composer/bin/test-reporter; fi
5759

5860
deploy:
5961
provider: releases
@@ -63,4 +65,4 @@ deploy:
6365
on:
6466
tags: true
6567
php: 5.3
66-
condition: "$WITH_HIGHEST == true && $WITH_PHAR == true"
68+
condition: "$BUILD_PHAR == true"

0 commit comments

Comments
 (0)