MNT Travis shared config, use sminnee/phpunit

This commit is contained in:
Steve Boyd 2020-12-02 15:41:59 +13:00
parent 3d50b3f9ec
commit 082742ad23
3 changed files with 28 additions and 40 deletions

View File

@ -1,53 +1,37 @@
language: php version: ~> 1.0
dist: xenial import:
- silverstripe/silverstripe-travis-shared:config/provision/standard.yml
services:
- postgresql
-
cache:
directories:
- $HOME/.composer/cache/files
php:
- 7.1
env: env:
global: 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 fast_finish: true
include: include:
- php: 7.1 - php: 7.1
env: env:
- PHPUNIT_TEST=framework - REQUIRE_INSTALLER="4.5.x-dev"
- PHPUNIT_SUITE="framework"
- php: 7.2 - php: 7.2
env: env:
- PHPUNIT_TEST=framework - REQUIRE_INSTALLER="4.6.x-dev"
- PHPUNIT_SUITE="postgresql"
- php: 7.3 - php: 7.3
env: env:
- PHPUNIT_TEST=framework - REQUIRE_INSTALLER="4.7.x-dev"
- php: 7.1
env:
- PHPUNIT_TEST=postgresql
- PHPCS_TEST=1 - PHPCS_TEST=1
- PHPUNIT_SUITE="framework"
before_script: - php: 7.4
# Init PHP env:
- phpenv rehash - REQUIRE_INSTALLER="4.x-dev"
- phpenv config-rm xdebug.ini - PHPUNIT_COVERAGE_TEST=1
- export PATH=~/.composer/vendor/bin:$PATH - PHPUNIT_SUITE="postgresql"
- echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - php: nightly
env:
# Install composer dependencies - REQUIRE_INSTALLER="4.x-dev"
- composer validate - PHPUNIT_SUITE="framework"
- composer require --no-update silverstripe/recipe-cms:4.3.x-dev - COMPOSER_INSTALL_ARG=--ignore-platform-reqs
- 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

View File

@ -19,7 +19,8 @@
"silverstripe/vendor-plugin": "^1.0" "silverstripe/vendor-plugin": "^1.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.7" "sminnee/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^3"
}, },
"extra": { }, "extra": { },
"autoload": { "autoload": {

View File

@ -2,6 +2,9 @@
<ruleset name="SilverStripe"> <ruleset name="SilverStripe">
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description> <description>CodeSniffer ruleset for SilverStripe coding conventions.</description>
<file>code</file>
<file>tests</file>
<!-- base rules are PSR-2 --> <!-- base rules are PSR-2 -->
<rule ref="PSR2" > <rule ref="PSR2" >
<!-- Current exclusions --> <!-- Current exclusions -->