Browse Source

Enhance Travis (#226)

master
Théo FIDRY 6 years ago committed by GitHub
parent
commit
88d1251f90
  1. 7
      .gitignore
  2. 2
      .scrutinizer.yml
  3. 56
      .travis.yml
  4. 5
      Makefile
  5. 4
      bin/console
  6. 5
      composer.json
  7. 13
      phpunit.xml.dist

7
.gitignore vendored

@ -1,7 +1,8 @@
vendor/*
vendor/
composer.lock
tests/SymfonyApp/cache
tests/SymfonyApp/logs
tests/SymfonyApp/cache/
tests/SymfonyApp/logs/
coverage.xml
phpunit.xml
.php_cs.cache
.phar/

2
.scrutinizer.yml

@ -6,4 +6,4 @@ filter:
tools:
external_code_coverage:
timeout: 1800
runs: 3
runs: 2

56
.travis.yml

@ -3,32 +3,40 @@ language: php
sudo: false
php:
- '5.5'
- '5.6'
- '7.0'
- nightly
- hhvm
env:
global:
- OCULAR_BIN=$HOME/.bin/ocular.phar
matrix:
fast_finish: true
include:
- php: '5.4'
env: COMPOSER_FLAGS="--prefer-lowest"
env: SYMFONY_VERSION=2.3.*
- php: '5.6'
env: SYMFONY_VERSION=2.3.*
env:
- COMPOSER_FLAGS="--prefer-lowest"
- COVERAGE_ENABLED="true"
- PHPUNIT_FLAGS="--coverage-text --coverage-clover=coverage.xml"
- SYMFONY_VERSION="~2.3.0"
- php: '5.6'
env: SYMFONY_VERSION="~2.7.0"
- php: '5.6'
env: SYMFONY_VERSION=2.7.*
env: SYMFONY_VERSION="~2.8.0"
- php: '5.6'
env: SYMFONY_VERSION=2.8.*
env: SYMFONY_VERSION="~3.0.0"
- php: '5.6'
env: SYMFONY_VERSION=3.0.*
env:
- SYMFONY_VERSION="~3.1.0"
- COVERAGE_ENABLED="true"
- PHPUNIT_FLAGS="--coverage-text --coverage-clover=coverage.xml"
- php: '5.6'
env: SYMFONY_VERSION="3.1.*@dev"
env: SYMFONY_VERSION="~3.2.0@dev"
allow_failures:
- php: '7.0'
- php: nightly
- php: hhvm
- env: SYMFONY_VERSION="3.1.*@dev"
- env: SYMFONY_VERSION="[email protected]"
services:
- mongodb
@ -37,20 +45,34 @@ services:
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/.bin/
before_install:
- composer self-update
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
- |
if [ "$SYMFONY_VERSION" != "" ]; then
composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update
fi
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- |
if [ -z "$COVERAGE_ENABLED" ]; then
phpenv config-rm xdebug.ini
elseif [ -f
wget https://scrutinizer-ci.com/ocular.phar
mv ocular.phar $HOME/.bin/
fi
install:
- if ([ "hhvm" != "$TRAVIS_PHP_VERSION" ] && [ "nightly" != "$TRAVIS_PHP_VERSION" ]); then wget https://scrutinizer-ci.com/ocular.phar; fi;
- composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
script: make test
script:
- phpunit --stop-on-failure $PHPUNIT_FLAGS
after_script:
- if ([ "hhvm" != "$TRAVIS_PHP_VERSION" ] && [ "nightly" != "$TRAVIS_PHP_VERSION" ]); then php ocular.phar code-coverage:upload --format=php-clover coverage.xml; fi;
- |
if [ -n "$COVERAGE_ENABLED" ]; then
php $OCULAR_BIN code-coverage:upload --format=php-clover coverage.xml
fi
notifications:
email: false

5
Makefile

@ -1,5 +0,0 @@
cs:
php-cs-fixer fix --verbose
test:
./vendor/bin/phpunit -c phpunit.xml.dist

4
console → bin/console

@ -14,8 +14,8 @@
// Debug only
set_time_limit(0);
require_once __DIR__.'/vendor/autoload.php';
require_once __DIR__.'/Tests/SymfonyApp/autoload.php';
require_once __DIR__.'/../vendor/autoload.php';
require_once __DIR__.'/../Tests/SymfonyApp/autoload.php';
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;

5
composer.json

@ -23,7 +23,7 @@
],
"require": {
"php": ">=5.4.0",
"nelmio/alice": "~2.1",
"nelmio/alice": "~2.1 < 2.2.0",
"symfony/finder": "^2.7|~3.0"
},
"require-dev": {
@ -65,6 +65,7 @@
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"sort-packages": true
}
}

13
phpunit.xml.dist

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.4/phpunit.xsd"
bootstrap="tests/SymfonyApp/autoload.php"
strict="true"
>
colors="true"
forceCoversAnnotation="true"
verbose="true">
<php>
<server name="KERNEL_DIR" value="tests/SymfonyApp" />
@ -11,11 +13,6 @@
<server name="SYMFONY__DATABASE__PASSWORD" value=""/>
</php>
<logging>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true" />
<log type="coverage-clover" target="coverage.xml" />
</logging>
<testsuites>
<testsuite name="AliceBundle Test Suite">
<directory>./tests</directory>

Loading…
Cancel
Save