From 3ee4ff4cb7d4f4cf88cd8c7d4ffe0eb592b9de57 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Fri, 1 Sep 2017 12:53:38 +1200 Subject: [PATCH] Update Travis configuration, add codecov.io and PHPUnit config --- .travis.yml | 45 ++++++++++++++++++++++++--------------------- codecov.yml | 1 + composer.json | 4 +++- phpunit.xml.dist | 14 ++++++++++++++ 4 files changed, 42 insertions(+), 22 deletions(-) create mode 100644 codecov.yml create mode 100644 phpunit.xml.dist diff --git a/.travis.yml b/.travis.yml index cc29166..d858917 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,31 @@ -# See https://github.com/silverstripe/silverstripe-travis-support for setup details - -sudo: false - language: php -dist: precise - -php: - - 5.6 - - 7.0 - - 7.1 - env: - - DB=MYSQL CORE_RELEASE=4 - - DB=PGSQL CORE_RELEASE=4 + global: + - COMPOSER_ROOT_VERSION="4.0.x-dev" + +matrix: + include: + - php: 5.6 + 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 --prefer-dist --no-progress --no-suggest - - composer require silverstripe/versioned:1.x-dev --prefer-dist --no-progress --no-suggest - - composer dump-autoload --optimize + - phpenv rehash + - phpenv config-rm xdebug.ini + + - composer validate + - composer require silverstripe/recipe-core 1.0.x-dev --no-update + - if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:2.0.x-dev --no-update; fi + - composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile script: - - vendor/bin/phpunit gridfieldextensions/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 diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..69cb760 --- /dev/null +++ b/codecov.yml @@ -0,0 +1 @@ +comment: false diff --git a/composer.json b/composer.json index 0f5133c..ecb98fa 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,9 @@ "silverstripe/framework": "~4.0" }, "require-dev": { - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.0", + "silverstripe/versioned": "^1@dev" }, "extra": { "installer-name": "gridfieldextensions", diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..d08e57c --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,14 @@ + + + tests + + + + + src/ + + tests/ + + + +