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
|
||||
/.travis.yml export-ignore
|
||||
/.scrutinizer.yml export-ignore
|
||||
/codecov.yml export-ignore
|
||||
|
64
.travis.yml
64
.travis.yml
@ -1,36 +1,54 @@
|
||||
# See https://github.com/silverstripe/silverstripe-travis-support for setup details
|
||||
|
||||
language: php
|
||||
|
||||
sudo: false
|
||||
|
||||
sudo: false
|
||||
|
||||
php:
|
||||
- 5.5
|
||||
addons:
|
||||
firefox: "31.0"
|
||||
|
||||
env:
|
||||
global:
|
||||
- CORE_RELEASE=4
|
||||
matrix:
|
||||
- DB=MYSQL
|
||||
- DB=PGSQL
|
||||
- COMPOSER_ROOT_VERSION="4.0.x-dev"
|
||||
- DISPLAY=":99"
|
||||
- XVFBARGS=":99 -ac -screen 0 1024x768x16"
|
||||
|
||||
matrix:
|
||||
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
|
||||
|
||||
before_script:
|
||||
- composer self-update || true
|
||||
- phpenv rehash
|
||||
- git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support
|
||||
- "if [ \"$BEHAT_TEST\" = \"\" ]; then php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss; fi"
|
||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require silverstripe/behat-extension; fi"
|
||||
- cd ~/builds/ss
|
||||
- php ~/travis-support/travis_setup_selenium.php --if-env BEHAT_TEST
|
||||
- php ~/travis-support/travis_setup_php54_webserver.php --if-env BEHAT_TEST
|
||||
- phpenv rehash
|
||||
- phpenv config-rm xdebug.ini
|
||||
- echo 'memory_limit = 2G' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
||||
|
||||
- composer install --prefer-dist
|
||||
- composer require silverstripe/recipe-cms 1.0.x-dev --no-update --prefer-dist
|
||||
- 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:
|
||||
- "if [ \"$BEHAT_TEST\" = \"\" ]; then vendor/bin/phpunit subsites/tests; fi"
|
||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @subsites; fi"
|
||||
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/php/ flush=1; 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": {
|
||||
"silverstripe/framework": "~4.0",
|
||||
"silverstripe/cms": "~4.0",
|
||||
"silverstripe/asset-admin": "~1.0.0"
|
||||
"silverstripe/framework": "^4",
|
||||
"silverstripe/cms": "^4",
|
||||
"silverstripe/admin": "^1",
|
||||
"silverstripe/asset-admin": "^1",
|
||||
"silverstripe/errorpage": "^1",
|
||||
"silverstripe/versioned": "^1"
|
||||
},
|
||||
"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": {
|
||||
"psr-4": {
|
||||
@ -28,5 +35,7 @@
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
|
@ -1,7 +1,14 @@
|
||||
<phpunit bootstrap="framework/tests/bootstrap.php" colors="true">
|
||||
<testsuite name="Default">
|
||||
<directory>tests/php</directory>
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="Default">
|
||||
<directory>tests/php</directory>
|
||||
</testsuite>
|
||||
|
||||
<filter>
|
||||
<whitelist addUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">code/</directory>
|
||||
<exclude>
|
||||
<directory suffix=".php">tests/</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
|
@ -1,11 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: dmooyman
|
||||
* Date: 27/05/16
|
||||
* Time: 3:10 PM
|
||||
*/
|
||||
use SilverStripe\Dev\FunctionalTest;
|
||||
|
||||
class SubsiteXHRControllerTest extends FunctionalTest
|
||||
{
|
||||
protected static $fixture_file = 'SubsiteTest.yml';
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
|
||||
/**
|
||||
* Tests {@see WildcardDomainField}
|
||||
*/
|
||||
@ -59,7 +61,7 @@ class WildcardDomainFieldTest extends SapphireTest {
|
||||
array('*.mysite.')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function validWildcards() {
|
||||
return array(
|
||||
array('*.mysite.com'),
|
||||
|
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 SilverStripe\CMS\Controllers\CMSMain;
|
||||
use SilverStripe\CMS\Controllers\ModelAsController;
|
||||
use SilverStripe\CMS\Model\ErrorPage;
|
||||
use SilverStripe\ErrorPage\ErrorPage;
|
||||
use SilverStripe\CMS\Model\SiteTree;
|
||||
use SilverStripe\Control\Director;
|
||||
use SilverStripe\Control\Session;
|
||||
|
Loading…
Reference in New Issue
Block a user