Skip to content

Commit

Permalink
Improve travis support
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewis-everley committed Jan 16, 2020
1 parent ea2aa3a commit e6c7a1e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
61 changes: 26 additions & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,39 @@
sudo: false

language: php
sudo: true

php:
- 5.4
- 5.5
- 5.6
services:
- mysql
- postgresql

env:
global:
- DB=MYSQL CORE_RELEASE=3.1
- MODULE_PATH=systemmessages
- COMPOSER_ROOT_VERSION="4.0.x-dev"

matrix:
include:
- php: 5.4
env: DB=SQLITE CORE_RELEASE=3.1
- php: 5.5
env: DB=PGSQL CORE_RELEASE=3.1
- php: 5.5
env: DB=SQLITE CORE_RELEASE=3.1
- php: 5.6
env: DB=SQLITE CORE_RELEASE=3.2
- php: 5.6
env: DB=SQLITE CORE_RELEASE=3.4
- php: 5.6
env: DB=PGSQL CORE_RELEASE=3.5
- php: 5.6
env: DB=PGSQL CORE_RELEASE=3.6
allow_failures:
- php: 7.0
- php: 7.1
env: DB=PGSQL INSTALLER_VERSION=4.2.x-dev PHPUNIT_TEST=1 UNIT_TESTS_RUNNING=1
- php: 7.1
env: DB=MYSQL INSTALLER_VERSION=4.2.x-dev PHPUNIT_COVERAGE_TEST=1 UNIT_TESTS_RUNNING=1
- php: 7.2
env: DB=MYSQL INSTALLER_VERSION=4.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1 UNIT_TESTS_RUNNING=1

before_script:
- composer self-update
- export PATH=~/.config/composer/vendor/bin:~/.composer/vendor/bin:$PATH

# Init PHP
- phpenv rehash
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require "ezyang/htmlpurifier:4.*,silverstripe/cms:~3.1"
- cd ~/builds/ss
- phpenv config-rm xdebug.ini
- echo 'memory_limit = 2G' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

# Install composer dependencies
- composer validate
- composer require --no-update silverstripe/installer:$INSTALLER_VERSION
- if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.x-dev; fi
- composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile

script:
- "if [ \"$COVERAGE\" = \"0\" ]; then vendor/bin/phpunit $MODULE_PATH/tests/; fi"
- "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"
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
- if [[ $PHPCS_TEST ]]; then composer run-script lint; fi
17 changes: 13 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,24 @@
"silverstripe/framework": "^4.1",
"gorriecoe/silverstripe-linkfield": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
},
"extra": {
"expose": [
"client/dist",
"node_modules"
"client/dist"
]
},
"autoload": {
"psr-4": {
"ilateral\\SilverStripe\\SystemMessages\\": "src/"
"ilateral\\SilverStripe\\SystemMessages\\": "src/",
"ilateral\\SilverStripe\\SystemMessages\\Tests\\": "tests/"
}
}
},
"scripts": {
"lint": "phpcs -s src/ tests/",
"lint-clean": "phpcbf src/ tests/"
},
"minimum-stability": "dev",
"prefer-stable": true
}

0 comments on commit e6c7a1e

Please sign in to comment.