-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
57 lines (47 loc) · 2.54 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
language: php
matrix:
# Test only on versions of Sf that are still supported. See: http://symfony.com/doc/current/contributing/community/releases.html#version-history
include:
- php: 5.6
env: SYMFONY_VERSION=2.7.* CODE_COVERAGE=0
- php: 7.0
env: SYMFONY_VERSION=2.8.* CODE_COVERAGE=1
- php: 7.1
env: SYMFONY_VERSION=3.4.* CODE_COVERAGE=0
- php: 7.2
env: SYMFONY_VERSION=4.2.* CODE_COVERAGE=0
- php: 7.3
env: SYMFONY_VERSION=4.3.* CODE_COVERAGE=0
before_install:
# This is mandatory or 'apt-get install' calls following will fail
- sudo apt-get update -qq
- sudo apt-get install rabbitmq-server -y
# Install a more recent Xdebug version, as the default one (2.2.7) crashes when generating code coverage
#- if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then ./Tests/travis/setup_xdebug.sh; fi
install:
# Disable xdebug for speed (executing composer), but allow us to re-enable it later
- export XDEBUG_INI=`php -i | grep xdebug.ini | grep home/travis | grep -v '=>' | head -1`
- export XDEBUG_INI=${XDEBUG_INI/,/}
- if [ "$XDEBUG_INI" != "" ]; then mv "$XDEBUG_INI" "$XDEBUG_INI.bak"; fi
# We might run composer install first, but then most of it would be undone anyway
- composer require --prefer-source --dev symfony/process:${SYMFONY_VERSION} symfony/framework-bundle:${SYMFONY_VERSION} symfony/finder:${SYMFONY_VERSION}
# Re-enable xdebug for when we need to generate code coverage
- if [ "$CODE_COVERAGE" = "1" -a "$XDEBUG_INI" != "" ]; then mv "$XDEBUG_INI.bak" "$XDEBUG_INI"; fi
before_script:
- if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then phpenv config-add Tests/travis/zzz_php.ini; fi
- cp phpunit.xml.dist phpunit.xml
script:
- if [ "$CODE_COVERAGE" = "1" ]; then ./vendor/phpunit/phpunit/phpunit --colors --coverage-clover=coverage.clover Tests/phpunit; else ./vendor/phpunit/phpunit/phpunit --colors Tests/phpunit; fi
after_failure:
# Display as much info as we can to help developers
- php -i
after_script:
# Upload code-coverage to Scrutinizer
- if [ "$CODE_COVERAGE" = "1" -a -f coverage.clover ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ "$CODE_COVERAGE" = "1" -a -f coverage.clover ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
# Upload code-coverage to CodeClimate
#- if [ "$CODE_COVERAGE" = "1" -a -f coverage.clover ]; then CODECLIMATE_REPO_TOKEN=TOBEGOTTEN ./vendor/bin/test-reporter --coverage-report=coverage.clover; fi
# Try to avoid problems with shared composer caches...
#cache:
# directories:
# - $COMPOSER_CACHE_DIR