Skip to content

Commit 3087bd3

Browse files
committed
Improve Travis configuration
This commit will put the quality assurance tools that Travis executes into a different stage and also add support to PHP 7.3. Signed-off-by: Henrique Moody <[email protected]>
1 parent 8fd9124 commit 3087bd3

File tree

2 files changed

+31
-24
lines changed

2 files changed

+31
-24
lines changed

.travis.yml

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,40 @@ sudo: false
22

33
language: php
44

5+
php:
6+
- 7.1
7+
- 7.2
8+
- 7.3
9+
- nightly
10+
511
cache:
612
directories:
713
- $HOME/.composer/cache
814

9-
matrix:
10-
include:
11-
- php: 7.1
12-
env: COMPOSER_ARGUMENTS="--prefer-lowest --prefer-stable"
13-
- php: 7.1
14-
- php: 7.2
15-
- php: nightly
15+
before_install:
16+
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
17+
18+
install: travis_retry composer install
19+
20+
script:
21+
- vendor/bin/phpunit --testsuite=unit
22+
- vendor/bin/phpunit --testsuite=integration
23+
24+
jobs:
1625
allow_failures:
1726
- php: nightly
18-
fast_finish: true
1927

20-
before_script:
21-
- composer update --prefer-dist ${COMPOSER_ARGUMENTS}
28+
include:
29+
- stage: Quality assurance
30+
env: CODE_COVERAGE
31+
before_script:
32+
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
33+
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
34+
script: vendor/bin/phpunit --coverage-clover ./clover.xml
35+
after_script:
36+
- wget https://scrutinizer-ci.com/ocular.phar
37+
- php ocular.phar code-coverage:upload --format=php-clover ./clover.xml
2238

23-
script:
24-
- vendor/bin/phpunit --colors --coverage-clover=test.clover
25-
- |
26-
if [[ "${TRAVIS_PHP_VERSION}" == "7.1" ]]; then
27-
vendor/bin/docheader check src/ tests/
28-
fi
29-
30-
after_script:
31-
- |
32-
if [[ "${TRAVIS_PHP_VERSION}" == "7.1" ]]; then
33-
wget https://scrutinizer-ci.com/ocular.phar
34-
php ocular.phar code-coverage:upload --format=php-clover test.clover
35-
fi
39+
- stage: Quality assurance
40+
env: DOCHEADER
41+
script: vendor/bin/docheader check src/ tests/

phpunit.xml.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
processIsolation="false"
99
stopOnFailure="false"
1010
syntaxCheck="false"
11-
verbose="false">
11+
colors="true"
12+
verbose="true">
1213
<testsuites>
1314
<testsuite name="unit">
1415
<directory suffix="Test.php">tests/unit/</directory>

0 commit comments

Comments
 (0)