diff --git a/.travis.yml b/.travis.yml index 0456f64..0c9bba9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,36 +1,44 @@ -# See https://github.com/silverstripe-labs/silverstripe-travis-support for setup details - -sudo: false - language: php -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 +dist: trusty + +cache: + directories: + - $HOME/.composer/cache/files env: - - DB=MYSQL CORE_RELEASE=3.2 + global: + - COMPOSER_ROOT_VERSION=4.0.x-dev matrix: include: - php: 5.6 - env: DB=MYSQL CORE_RELEASE=3 - - php: 5.6 - env: DB=MYSQL CORE_RELEASE=3.1 - - php: 5.6 - env: DB=PGSQL CORE_RELEASE=3.2 - allow_failures: + env: DB=MYSQL INSTALLER_VERSION=4.0.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1 - php: 7.0 + env: DB=PGSQL INSTALLER_VERSION=4.1.x-dev PHPUNIT_TEST=1 + - php: 7.1 + env: DB=MYSQL INSTALLER_VERSION=4.2.x-dev PHPUNIT_COVERAGE_TEST=1 + - php: 7.2 + env: DB=MYSQL INSTALLER_VERSION=4.x-dev PHPUNIT_TEST=1 before_script: - - composer self-update || true - - git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support - - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss - - cd ~/builds/ss - - composer install + # Init PHP + - phpenv rehash + - phpenv config-rm xdebug.ini + + # Install composer dependencies + - composer validate + - echo $INSTALLER_VERSION + - composer require --prefer-source --no-update silverstripe/recipe-cms:1.1.x-dev + - if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.0.x-dev; fi + - composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile + - vendor/bin/sake flush=all + + - php vendor/silverstripe/framework/tests/dump_constants.php script: - - vendor/bin/phpunit mathspamprotection/tests + - if [[ $PHPUNIT_TEST ]]; then find . | grep Sapphire && vendor/bin/phpunit tests/; fi + - if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml tests/; fi + +after_success: + - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi