From 082742ad232a76a15e908ce3604bfd059de1bbc8 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 2 Dec 2020 15:41:59 +1300 Subject: [PATCH] MNT Travis shared config, use sminnee/phpunit --- .travis.yml | 62 +++++++++++++++++++------------------------------- composer.json | 3 ++- phpcs.xml.dist | 3 +++ 3 files changed, 28 insertions(+), 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index a89dda4..de05bc0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,53 +1,37 @@ -language: php +version: ~> 1.0 -dist: xenial - -services: - - postgresql - - - -cache: - directories: - - $HOME/.composer/cache/files - -php: - - 7.1 +import: + - silverstripe/silverstripe-travis-shared:config/provision/standard.yml env: global: - - DB="PGSQL" + - DB=PGSQL + - PHPUNIT_TEST=1 -matrix: +# Using a custom jobs matrix as every DB=PGSQL and there is alternating PHPUNIT_SUITE's +jobs: fast_finish: true include: - php: 7.1 env: - - PHPUNIT_TEST=framework + - REQUIRE_INSTALLER="4.5.x-dev" + - PHPUNIT_SUITE="framework" - php: 7.2 env: - - PHPUNIT_TEST=framework + - REQUIRE_INSTALLER="4.6.x-dev" + - PHPUNIT_SUITE="postgresql" - php: 7.3 env: - - PHPUNIT_TEST=framework - - php: 7.1 - env: - - PHPUNIT_TEST=postgresql + - REQUIRE_INSTALLER="4.7.x-dev" - PHPCS_TEST=1 - -before_script: -# Init PHP - - phpenv rehash - - phpenv config-rm xdebug.ini - - export PATH=~/.composer/vendor/bin:$PATH - - echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - -# Install composer dependencies - - composer validate - - composer require --no-update silverstripe/recipe-cms:4.3.x-dev - - composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile - - if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o; fi - -script: - - if [[ $PHPUNIT_TEST == postgresql ]]; then vendor/bin/phpunit ./tests; fi - - if [[ $PHPUNIT_TEST == framework ]]; then vendor/bin/phpunit ./vendor/silverstripe/framework/tests/php; fi - - if [[ $PHPCS_TEST ]]; then composer run-script lint; fi + - PHPUNIT_SUITE="framework" + - php: 7.4 + env: + - REQUIRE_INSTALLER="4.x-dev" + - PHPUNIT_COVERAGE_TEST=1 + - PHPUNIT_SUITE="postgresql" + - php: nightly + env: + - REQUIRE_INSTALLER="4.x-dev" + - PHPUNIT_SUITE="framework" + - COMPOSER_INSTALL_ARG=--ignore-platform-reqs diff --git a/composer.json b/composer.json index a2cd095..4c89b41 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "silverstripe/vendor-plugin": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^5.7" + "sminnee/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3" }, "extra": { }, "autoload": { diff --git a/phpcs.xml.dist b/phpcs.xml.dist index b2ed508..9adaf91 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -2,6 +2,9 @@ CodeSniffer ruleset for SilverStripe coding conventions. + code + tests +