Improve Travis CI configuration for better performance.

Props netweb, jorbin.
Fixes #28301.


git-svn-id: https://develop.svn.wordpress.org/trunk@28799 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-06-21 20:05:19 +00:00
parent 72a61e941d
commit 562d64a4a3
2 changed files with 46 additions and 15 deletions

View File

@ -1,19 +1,47 @@
# Travis CI Configuration File
# Tell Travis CI we're using PHP
language: php
php:
- "5.2"
- "5.3"
- "5.4"
- "5.5"
# Build matrix options
matrix:
include:
- php: 5.5
env: WP_TRAVISCI=travis:js
- php: 5.2
env: WP_TRAVISCI=travis:phpunit
- php: 5.3
env: WP_TRAVISCI=travis:phpunit
- php: 5.4
env: WP_TRAVISCI=travis:phpunit
- php: 5.5
env: WP_TRAVISCI=travis:phpunit
- php: 5.6
env: WP_TRAVISCI=travis:phpunit
- php: hhvm
env: WP_TRAVISCI=travis:phpunit
allow_failures:
- php: 5.6
- php: hhvm
fast_finish: true
# Before install, failures in this section will result in build status 'errored'
before_install:
- WP_CORE_DIR=/tmp/wordpress/
- >
if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
mysql -e "CREATE DATABASE wordpress_tests;" -uroot
cp wp-tests-config-sample.php wp-tests-config.php
sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
sed -i "s/yourusernamehere/travis/" wp-tests-config.php
sed -i "s/yourpasswordhere//" wp-tests-config.php
svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
fi
# Before script, failures in this section will result in build status 'failed'
before_script:
- mysql -e "CREATE DATABASE wordpress_tests;" -uroot
- cp wp-tests-config-sample.php wp-tests-config.php
- sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
- sed -i "s/yourusernamehere/travis/" wp-tests-config.php
- sed -i "s/yourpasswordhere//" wp-tests-config.php
- svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
- npm install -g grunt-cli
- npm install
script: grunt travis
# Script, failures in this section will result in build status 'failed'
script: grunt $WP_TRAVISCI

View File

@ -473,7 +473,10 @@ module.exports = function(grunt) {
['build', 'copy:qunit', 'qunit']);
grunt.registerTask('test', 'Runs all QUnit and PHPUnit tasks.', ['qunit:compiled', 'phpunit']);
grunt.registerTask('travis', ['jshint', 'test']);
// Travis CI tasks.
grunt.registerTask('travis:js', 'Runs Javascript Travis CI tasks.', [ 'jshint', 'qunit:compiled' ]);
grunt.registerTask('travis:phpunit', 'Runs PHPUnit Travis CI tasks.', 'phpunit');
// Patch task.
grunt.renameTask('patch_wordpress', 'patch');