forked from kaliop-uk/kueueingbundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
67 lines (55 loc) · 2.82 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
language: php
# Sudo: false should make the builds faster, but collides with rabbitmq
sudo: true
matrix:
# Test only on versions of Sf that are still supported. See: http://symfony.com/doc/current/contributing/community/releases.html#version-history
include:
# We are no more compatible with SF 2.3
#- php: 5.3
# env: SYMFONY_VERSION=2.3.*
- php: 5.4
env: SYMFONY_VERSION=2.6.* CODE_COVERAGE=0
- php: 5.5
env: SYMFONY_VERSION=2.7.* CODE_COVERAGE=0
- php: 5.6
env: SYMFONY_VERSION=2.8.* CODE_COVERAGE=1
- php: 7.0
env: SYMFONY_VERSION=3.0.* CODE_COVERAGE=0
- php: hhvm
env: SYMFONY_VERSION=3.1.* CODE_COVERAGE=0
services:
- rabbitmq
before_install:
# This is mandatory or 'apt-get install' calls following will fail
#- sudo apt-get update -qq
# 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
# NB: 'php -i' does not work on hhvm
- if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then export XDEBUG_INI=''; fi
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then export XDEBUG_INI=`php -i | grep xdebug.ini | grep home/travis | grep -v '=>' | head -1`; fi
- export XDEBUG_INI=${XDEBUG_INI/,/}
- if [ "$XDEBUG_INI" != "" ]; then mv "$XDEBUG_INI" "$XDEBUG_INI.bak"; fi
- composer self-update
# 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 phpunit --colors --coverage-clover=coverage.clover Tests/phpunit; else phpunit --colors Tests/phpunit; fi
after_failure:
# Display as much info as we can to help developers
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php -i; fi
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
cache:
directories:
- $COMPOSER_CACHE_DIR