From c8863f69770f9f9fd30d99daa4e3b8342080d19a Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 2 Oct 2012 21:34:53 +0200 Subject: [PATCH] ENHANCEMENT Travis CI support --- .travis.yml | 29 +++++++++++++++++++++++++ README.md | 2 ++ tests/phpcs/ruleset.xml | 33 ++++++++++++++++++++++++++++ tests/travis/_config.php | 22 +++++++++++++++++++ tests/travis/_ss_environment.php | 37 ++++++++++++++++++++++++++++++++ tests/travis/before_script | 25 +++++++++++++++++++++ 6 files changed, 148 insertions(+) create mode 100644 .travis.yml create mode 100644 tests/phpcs/ruleset.xml create mode 100644 tests/travis/_config.php create mode 100644 tests/travis/_ss_environment.php create mode 100755 tests/travis/before_script diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..eda5fc6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,29 @@ +language: php +php: + - 5.3 + - 5.4 + +env: + - TESTDB=MYSQL CORE_RELEASE=3.0 + - TESTDB=MYSQL CORE_RELEASE=master + - TESTDB=PGSQL CORE_RELEASE=master + - TESTDB=SQLITE CORE_RELEASE=master + +matrix: + exclude: + - php: 5.4 + env: TESTDB=PGSQL CORE_RELEASE=master + - php: 5.4 + env: TESTDB=SQLITE CORE_RELEASE=master + - php: 5.4 + env: TESTDB=MYSQL CORE_RELEASE=3.0 + +before_script: + - pear -q install --onlyreqdeps pear/PHP_CodeSniffer + - phpenv rehash + - ./tests/travis/before_script ~/builds/ss + - cd ~/builds/ss + +script: + - phpunit translatable/tests/ + - phpcs --encoding=utf-8 --tab-width=4 --standard=translatable/tests/phpcs -np translatable diff --git a/README.md b/README.md index ff5b9aa..78413e0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Translatable module for SilverStripe CMS # +[![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-translatable.png)](http://travis-ci.org/silverstripe/silverstripe-translatable) + ## Introduction ## Allows translation of DataObject and SiteTree records into multiple languages. diff --git a/tests/phpcs/ruleset.xml b/tests/phpcs/ruleset.xml new file mode 100644 index 0000000..383e2f0 --- /dev/null +++ b/tests/phpcs/ruleset.xml @@ -0,0 +1,33 @@ + + + CodeSniffer ruleset for SilverStripe coding conventions. + + + */css/* + css/* + + + thirdparty/* + + + 8 + + + + + + + + 7 + + + 8 + + + + + + + + + diff --git a/tests/travis/_config.php b/tests/travis/_config.php new file mode 100644 index 0000000..3508957 --- /dev/null +++ b/tests/travis/_config.php @@ -0,0 +1,22 @@ + + +BUILD_DIR=$1 + +# Fetch all dependencies +# TODO Replace with different composer.json variations +echo "Checking out installer@$CORE_RELEASE" +git clone --depth=100 --quiet --branch $CORE_RELEASE git://github.com/silverstripe/silverstripe-installer.git $BUILD_DIR +echo "Checking out cms@$CORE_RELEASE" +git clone --depth=100 --quiet --branch $CORE_RELEASE git://github.com/silverstripe/silverstripe-cms.git $BUILD_DIR/cms +echo "Checking out framework@$CORE_RELEASE" +git clone --depth=100 --quiet --branch $CORE_RELEASE git://github.com/silverstripe/sapphire.git $BUILD_DIR/framework +echo "Checking out sqlite3" +git clone --depth=100 --quiet git://github.com/silverstripe-labs/silverstripe-sqlite3.git $BUILD_DIR/sqlite3 +echo "Checking out postgresql" +git clone --depth=100 --quiet git://github.com/silverstripe/silverstripe-postgresql.git $BUILD_DIR/postgresql + +# Copy setup files +cp ./tests/travis/_ss_environment.php $BUILD_DIR +cp ./tests/travis/_config.php $BUILD_DIR/mysite + +# Copy actual project code into build directory (checked out by travis) +cp -r . $BUILD_DIR/translatable + +cd $BUILD_DIR