Skip to content

Commit

Permalink
FIX Update Travis configuration to be standalone, add codecov.io
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Aug 25, 2017
1 parent 5437f6b commit ad6a965
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
38 changes: 21 additions & 17 deletions .travis.yml
@@ -1,28 +1,32 @@
# See https://github.com/silverstripe/silverstripe-travis-support for setup details

sudo: false

language: php

php:
- 5.6
- 7.0
- 7.1

env:
- DB=MYSQL CORE_RELEASE=4
global:
- COMPOSER_ROOT_VERSION="4.0.x-dev"

matrix:
include:
- php: 5.6
env: DB=PGSQL CORE_RELEASE=4
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
- php: 7.0
env: DB=PGSQL PHPUNIT_TEST=1
- php: 7.1
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1

before_script:
- composer self-update || true
- git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss
- cd ~/builds/ss
- composer install
- phpenv rehash
- phpenv config-rm xdebug.ini

- composer install --prefer-dist
- composer require --prefer-dist --no-update silverstripe/framework:4.0.x-dev
- composer update

- if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:2.0.x-dev --prefer-dist; fi

script:
- vendor/bin/phpunit widgets/tests
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs --standard=framework/phpcs.xml.dist src/ tests/ ; fi

after_success:
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi
1 change: 1 addition & 0 deletions codecov.yml
@@ -0,0 +1 @@
comment: false
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -14,7 +14,8 @@
"silverstripe/cms": "^4.0@dev"
},
"require-dev": {
"phpunit/PHPUnit": "~4.8"
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "*"
},
"extra": {
"branch-alias": {
Expand Down
14 changes: 14 additions & 0 deletions phpunit.xml.dist
@@ -0,0 +1,14 @@
<phpunit bootstrap="cms/tests/bootstrap.php" colors="true">
<testsuite name="Default">
<directory>tests</directory>
</testsuite>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory>
<exclude>
<directory suffix=".php">tests/</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

0 comments on commit ad6a965

Please sign in to comment.