Skip to content

Commit 88d1251

Browse files
authored
Enhance Travis (#226)
1 parent 0488a66 commit 88d1251

File tree

7 files changed

+54
-38
lines changed

7 files changed

+54
-38
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
vendor/*
1+
vendor/
22
composer.lock
3-
tests/SymfonyApp/cache
4-
tests/SymfonyApp/logs
3+
tests/SymfonyApp/cache/
4+
tests/SymfonyApp/logs/
55
coverage.xml
66
phpunit.xml
77
.php_cs.cache
8+
.phar/

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ filter:
66
tools:
77
external_code_coverage:
88
timeout: 1800
9-
runs: 3
9+
runs: 2

.travis.yml

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,40 @@ language: php
33
sudo: false
44

55
php:
6-
- '5.5'
6+
- '5.6'
77
- '7.0'
88
- nightly
9-
- hhvm
9+
10+
env:
11+
global:
12+
- OCULAR_BIN=$HOME/.bin/ocular.phar
1013

1114
matrix:
1215
fast_finish: true
1316
include:
14-
- php: '5.4'
15-
env: COMPOSER_FLAGS="--prefer-lowest"
16-
env: SYMFONY_VERSION=2.3.*
1717
- php: '5.6'
18-
env: SYMFONY_VERSION=2.3.*
18+
env:
19+
- COMPOSER_FLAGS="--prefer-lowest"
20+
- COVERAGE_ENABLED="true"
21+
- PHPUNIT_FLAGS="--coverage-text --coverage-clover=coverage.xml"
22+
- SYMFONY_VERSION="~2.3.0"
23+
- php: '5.6'
24+
env: SYMFONY_VERSION="~2.7.0"
1925
- php: '5.6'
20-
env: SYMFONY_VERSION=2.7.*
26+
env: SYMFONY_VERSION="~2.8.0"
2127
- php: '5.6'
22-
env: SYMFONY_VERSION=2.8.*
28+
env: SYMFONY_VERSION="~3.0.0"
2329
- php: '5.6'
24-
env: SYMFONY_VERSION=3.0.*
30+
env:
31+
- SYMFONY_VERSION="~3.1.0"
32+
- COVERAGE_ENABLED="true"
33+
- PHPUNIT_FLAGS="--coverage-text --coverage-clover=coverage.xml"
2534
- php: '5.6'
26-
env: SYMFONY_VERSION="3.1.*@dev"
35+
env: SYMFONY_VERSION="~3.2.0@dev"
2736
allow_failures:
2837
- php: '7.0'
2938
- php: nightly
30-
- php: hhvm
31-
- env: SYMFONY_VERSION="3.1.*@dev"
39+
- env: SYMFONY_VERSION="~3.2.0@dev"
3240

3341
services:
3442
- mongodb
@@ -37,20 +45,34 @@ services:
3745
cache:
3846
directories:
3947
- $HOME/.composer/cache/files
48+
- $HOME/.bin/
4049

4150
before_install:
42-
- composer self-update
43-
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
51+
- |
52+
if [ "$SYMFONY_VERSION" != "" ]; then
53+
composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update
54+
fi
55+
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
4456
- echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
57+
- |
58+
if [ -z "$COVERAGE_ENABLED" ]; then
59+
phpenv config-rm xdebug.ini
60+
elseif [ -f
61+
wget https://scrutinizer-ci.com/ocular.phar
62+
mv ocular.phar $HOME/.bin/
63+
fi
4564
4665
install:
47-
- if ([ "hhvm" != "$TRAVIS_PHP_VERSION" ] && [ "nightly" != "$TRAVIS_PHP_VERSION" ]); then wget https://scrutinizer-ci.com/ocular.phar; fi;
4866
- composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
4967

50-
script: make test
68+
script:
69+
- phpunit --stop-on-failure $PHPUNIT_FLAGS
5170

5271
after_script:
53-
- if ([ "hhvm" != "$TRAVIS_PHP_VERSION" ] && [ "nightly" != "$TRAVIS_PHP_VERSION" ]); then php ocular.phar code-coverage:upload --format=php-clover coverage.xml; fi;
72+
- |
73+
if [ -n "$COVERAGE_ENABLED" ]; then
74+
php $OCULAR_BIN code-coverage:upload --format=php-clover coverage.xml
75+
fi
5476
5577
notifications:
5678
email: false

Makefile

Lines changed: 0 additions & 5 deletions
This file was deleted.

console renamed to bin/console

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// Debug only
1515
set_time_limit(0);
1616

17-
require_once __DIR__.'/vendor/autoload.php';
18-
require_once __DIR__.'/Tests/SymfonyApp/autoload.php';
17+
require_once __DIR__.'/../vendor/autoload.php';
18+
require_once __DIR__.'/../Tests/SymfonyApp/autoload.php';
1919

2020
use Symfony\Bundle\FrameworkBundle\Console\Application;
2121
use Symfony\Component\Console\Input\ArgvInput;

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
"require": {
2525
"php": ">=5.4.0",
26-
"nelmio/alice": "~2.1",
26+
"nelmio/alice": "~2.1 < 2.2.0",
2727
"symfony/finder": "^2.7|~3.0"
2828
},
2929
"require-dev": {
@@ -65,6 +65,7 @@
6565
"extra": {
6666
"branch-alias": {
6767
"dev-master": "1.x-dev"
68-
}
68+
},
69+
"sort-packages": true
6970
}
7071
}

phpunit.xml.dist

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit colors="true"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.4/phpunit.xsd"
34
bootstrap="tests/SymfonyApp/autoload.php"
4-
strict="true"
5-
>
5+
colors="true"
6+
forceCoversAnnotation="true"
7+
verbose="true">
68

79
<php>
810
<server name="KERNEL_DIR" value="tests/SymfonyApp" />
@@ -11,11 +13,6 @@
1113
<server name="SYMFONY__DATABASE__PASSWORD" value=""/>
1214
</php>
1315

14-
<logging>
15-
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true" />
16-
<log type="coverage-clover" target="coverage.xml" />
17-
</logging>
18-
1916
<testsuites>
2017
<testsuite name="AliceBundle Test Suite">
2118
<directory>./tests</directory>

0 commit comments

Comments
 (0)