Update Travis builds to include PHP 7, update PHPUnit to 5.7

This commit is contained in:
Robbie Averill 2019-07-24 12:41:30 +02:00
parent 892d97ad6c
commit 785f51c30f
2 changed files with 16 additions and 36 deletions

View File

@ -1,33 +1,21 @@
# See https://github.com/silverstripe/silverstripe-travis-support for setup details
sudo: false
dist: trusty
language: php
php:
- 5.6
env:
global:
- DB=MYSQL CORE_RELEASE=3
- MODULE_PATH=iframe
- COVERAGE=0
matrix:
include:
- php: 5.6
env: DB=MYSQL CORE_RELEASE=3.5
- php: 5.6
env: DB=PGSQL CORE_RELEASE=3
# Allowed to fail, meaning delayed code coverage reports
- php: 5.5.9
env: DB=MYSQL CORE_RELEASE=3 COVERAGE=1
allow_failures:
- php: 5.5.9
fast_finish: true
before_install:
- pip install --user codecov
- php: '5.6'
env: DB=MYSQL CORE_RELEASE=3.6
- php: '7.0'
env: DB=PGSQL CORE_RELEASE=3.7
- php: '7.1'
env: DB=MYSQL CORE_RELEASE=3.7
- php: '7.2'
env: DB=MYSQL CORE_RELEASE=3.7
- php: '7.3'
env: DB=MYSQL CORE_RELEASE=3.7
before_script:
- composer self-update || true
@ -37,15 +25,4 @@ before_script:
- composer install
script:
# Execute tests with no coverage. This is the fastest option
- "if [ \"$COVERAGE\" = \"0\" ]; then vendor/bin/phpunit $MODULE_PATH/tests/; fi"
# Execute tests with coverage. Do this for a small
- "if [ \"$COVERAGE\" = \"1\" ]; then vendor/bin/phpunit --coverage-clover=coverage.clover $MODULE_PATH/tests/; fi"
after_script:
- "if [ \"$COVERAGE\" = \"1\" ]; then mv coverage.clover ~/build/$TRAVIS_REPO_SLUG/; fi"
- cd ~/build/$TRAVIS_REPO_SLUG
- wget https://scrutinizer-ci.com/ocular.phar
- "if [ \"$COVERAGE\" = \"1\" ]; then travis_retry codecov && travis_retry php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi"
- vendor/bin/phpunit iframe/tests

View File

@ -16,5 +16,8 @@
"silverstripe/framework": "3.*",
"silverstripe/cms": "3.*"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
},
"extra": []
}
}