mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Update Travis configuration for PHP 5.6-7.1, add composer dependencies and codecov.io config
This commit is contained in:
parent
60725e7b5c
commit
9fdc1d6607
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -4,3 +4,4 @@
|
|||||||
/.gitignore export-ignore
|
/.gitignore export-ignore
|
||||||
/.travis.yml export-ignore
|
/.travis.yml export-ignore
|
||||||
/.scrutinizer.yml export-ignore
|
/.scrutinizer.yml export-ignore
|
||||||
|
/codecov.yml export-ignore
|
||||||
|
62
.travis.yml
62
.travis.yml
@ -1,36 +1,54 @@
|
|||||||
# See https://github.com/silverstripe/silverstripe-travis-support for setup details
|
|
||||||
|
|
||||||
language: php
|
language: php
|
||||||
|
|
||||||
sudo: false
|
addons:
|
||||||
|
firefox: "31.0"
|
||||||
sudo: false
|
|
||||||
|
|
||||||
php:
|
|
||||||
- 5.5
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- CORE_RELEASE=4
|
- COMPOSER_ROOT_VERSION="4.0.x-dev"
|
||||||
matrix:
|
- DISPLAY=":99"
|
||||||
- DB=MYSQL
|
- XVFBARGS=":99 -ac -screen 0 1024x768x16"
|
||||||
- DB=PGSQL
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- php: 5.5
|
- 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
|
||||||
|
- php: 7.0
|
||||||
env: DB=MYSQL BEHAT_TEST=1
|
env: DB=MYSQL BEHAT_TEST=1
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- composer self-update || true
|
|
||||||
- phpenv rehash
|
- phpenv rehash
|
||||||
- git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support
|
- phpenv config-rm xdebug.ini
|
||||||
- "if [ \"$BEHAT_TEST\" = \"\" ]; then php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss; fi"
|
- echo 'memory_limit = 2G' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
||||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require silverstripe/behat-extension; fi"
|
|
||||||
- cd ~/builds/ss
|
- composer install --prefer-dist
|
||||||
- php ~/travis-support/travis_setup_selenium.php --if-env BEHAT_TEST
|
- composer require silverstripe/recipe-cms 1.0.x-dev --no-update --prefer-dist
|
||||||
- php ~/travis-support/travis_setup_php54_webserver.php --if-env BEHAT_TEST
|
- if [[ $DB == PGSQL ]]; then composer require --prefer-dist --no-update silverstripe/postgresql:2.0.x-dev; fi
|
||||||
|
- composer update
|
||||||
|
|
||||||
|
# Bootstrap cms / mysite folder
|
||||||
|
- php ./cms/tests/bootstrap/mysite.php
|
||||||
|
|
||||||
|
# Behat bootstrapping
|
||||||
|
- if [[ $BEHAT_TEST ]]; then echo "" >> .env && echo "SS_BASE_URL=http://localhost:8080/" >> .env; fi
|
||||||
|
- if [[ $BEHAT_TEST ]]; then mkdir artifacts; fi
|
||||||
|
- if [[ $BEHAT_TEST ]]; then sh -e /etc/init.d/xvfb start; sleep 3; fi
|
||||||
|
- if [[ $BEHAT_TEST ]]; then (vendor/bin/selenium-server-standalone > artifacts/selenium.log 2>&1 &); fi
|
||||||
|
- if [[ $BEHAT_TEST ]]; then (vendor/bin/serve --bootstrap-file cms/tests/behat/serve-bootstrap.php &> artifacts/serve.log &); fi
|
||||||
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- "if [ \"$BEHAT_TEST\" = \"\" ]; then vendor/bin/phpunit subsites/tests; fi"
|
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/php/ flush=1; fi
|
||||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @subsites; 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 code/ tests/ ; fi
|
||||||
|
- if [[ $BEHAT_TEST ]]; then vendor/bin/behat @subsites; fi
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi
|
||||||
|
|
||||||
|
after_failure:
|
||||||
|
- if [[ $BEHAT_TEST ]]; then php ./framework/tests/behat/travis-upload-artifacts.php --if-env BEHAT_TEST,ARTIFACTS_BUCKET,ARTIFACTS_KEY,ARTIFACTS_SECRET --target-path $TRAVIS_REPO_SLUG/$TRAVIS_BUILD_ID/$TRAVIS_JOB_ID --artifacts-base-url https://s3.amazonaws.com/$ARTIFACTS_BUCKET/ --artifacts-path ./artifacts/; fi
|
||||||
|
1
codecov.yml
Normal file
1
codecov.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
comment: false
|
@ -11,12 +11,19 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"silverstripe/framework": "~4.0",
|
"silverstripe/framework": "^4",
|
||||||
"silverstripe/cms": "~4.0",
|
"silverstripe/cms": "^4",
|
||||||
"silverstripe/asset-admin": "~1.0.0"
|
"silverstripe/admin": "^1",
|
||||||
|
"silverstripe/asset-admin": "^1",
|
||||||
|
"silverstripe/errorpage": "^1",
|
||||||
|
"silverstripe/versioned": "^1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/PHPUnit": "~4.8@stable"
|
"phpunit/phpunit": "^5.7",
|
||||||
|
"squizlabs/php_codesniffer": "^3.0",
|
||||||
|
"silverstripe/behat-extension": "^3",
|
||||||
|
"silverstripe/serve": "dev-master",
|
||||||
|
"se/selenium-server-standalone": "2.41.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@ -28,5 +35,7 @@
|
|||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "2.0.x-dev"
|
"dev-master": "2.0.x-dev"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"minimum-stability": "dev",
|
||||||
|
"prefer-stable": true
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
<phpunit bootstrap="framework/tests/bootstrap.php" colors="true">
|
<phpunit bootstrap="framework/tests/bootstrap.php" colors="true">
|
||||||
|
|
||||||
<testsuite name="Default">
|
<testsuite name="Default">
|
||||||
<directory>tests/php</directory>
|
<directory>tests/php</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<whitelist addUncoveredFilesFromWhitelist="true">
|
||||||
|
<directory suffix=".php">code/</directory>
|
||||||
|
<exclude>
|
||||||
|
<directory suffix=".php">tests/</directory>
|
||||||
|
</exclude>
|
||||||
|
</whitelist>
|
||||||
|
</filter>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
use SilverStripe\Dev\FunctionalTest;
|
||||||
* Created by PhpStorm.
|
|
||||||
* User: dmooyman
|
|
||||||
* Date: 27/05/16
|
|
||||||
* Time: 3:10 PM
|
|
||||||
*/
|
|
||||||
class SubsiteXHRControllerTest extends FunctionalTest
|
class SubsiteXHRControllerTest extends FunctionalTest
|
||||||
{
|
{
|
||||||
protected static $fixture_file = 'SubsiteTest.yml';
|
protected static $fixture_file = 'SubsiteTest.yml';
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use SilverStripe\Dev\SapphireTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@see WildcardDomainField}
|
* Tests {@see WildcardDomainField}
|
||||||
*/
|
*/
|
||||||
|
0
tests/behat/_manifest_exclude
Normal file
0
tests/behat/_manifest_exclude
Normal file
@ -5,7 +5,7 @@ namespace SilverStripe\Subsites\Tests;
|
|||||||
use Page;
|
use Page;
|
||||||
use SilverStripe\CMS\Controllers\CMSMain;
|
use SilverStripe\CMS\Controllers\CMSMain;
|
||||||
use SilverStripe\CMS\Controllers\ModelAsController;
|
use SilverStripe\CMS\Controllers\ModelAsController;
|
||||||
use SilverStripe\CMS\Model\ErrorPage;
|
use SilverStripe\ErrorPage\ErrorPage;
|
||||||
use SilverStripe\CMS\Model\SiteTree;
|
use SilverStripe\CMS\Model\SiteTree;
|
||||||
use SilverStripe\Control\Director;
|
use SilverStripe\Control\Director;
|
||||||
use SilverStripe\Control\Session;
|
use SilverStripe\Control\Session;
|
||||||
|
Loading…
Reference in New Issue
Block a user