Skip to content

Commit 562d64a

Browse files
committed
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
1 parent 72a61e9 commit 562d64a

2 files changed

Lines changed: 46 additions & 15 deletions

File tree

.travis.yml

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,47 @@
1+
# Travis CI Configuration File
2+
3+
# Tell Travis CI we're using PHP
14
language: php
25

3-
php:
4-
- "5.2"
5-
- "5.3"
6-
- "5.4"
7-
- "5.5"
6+
# Build matrix options
7+
matrix:
8+
include:
9+
- php: 5.5
10+
env: WP_TRAVISCI=travis:js
11+
- php: 5.2
12+
env: WP_TRAVISCI=travis:phpunit
13+
- php: 5.3
14+
env: WP_TRAVISCI=travis:phpunit
15+
- php: 5.4
16+
env: WP_TRAVISCI=travis:phpunit
17+
- php: 5.5
18+
env: WP_TRAVISCI=travis:phpunit
19+
- php: 5.6
20+
env: WP_TRAVISCI=travis:phpunit
21+
- php: hhvm
22+
env: WP_TRAVISCI=travis:phpunit
23+
allow_failures:
24+
- php: 5.6
25+
- php: hhvm
26+
fast_finish: true
27+
28+
# Before install, failures in this section will result in build status 'errored'
29+
before_install:
30+
- WP_CORE_DIR=/tmp/wordpress/
31+
- >
32+
if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
33+
mysql -e "CREATE DATABASE wordpress_tests;" -uroot
34+
cp wp-tests-config-sample.php wp-tests-config.php
35+
sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
36+
sed -i "s/yourusernamehere/travis/" wp-tests-config.php
37+
sed -i "s/yourpasswordhere//" wp-tests-config.php
38+
svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
39+
fi
840
41+
# Before script, failures in this section will result in build status 'failed'
942
before_script:
10-
- mysql -e "CREATE DATABASE wordpress_tests;" -uroot
11-
- cp wp-tests-config-sample.php wp-tests-config.php
12-
- sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
13-
- sed -i "s/yourusernamehere/travis/" wp-tests-config.php
14-
- sed -i "s/yourpasswordhere//" wp-tests-config.php
15-
- svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
16-
- npm install -g grunt-cli
17-
- npm install
43+
- npm install -g grunt-cli
44+
- npm install
1845

19-
script: grunt travis
46+
# Script, failures in this section will result in build status 'failed'
47+
script: grunt $WP_TRAVISCI

Gruntfile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,10 @@ module.exports = function(grunt) {
473473
['build', 'copy:qunit', 'qunit']);
474474

475475
grunt.registerTask('test', 'Runs all QUnit and PHPUnit tasks.', ['qunit:compiled', 'phpunit']);
476-
grunt.registerTask('travis', ['jshint', 'test']);
476+
477+
// Travis CI tasks.
478+
grunt.registerTask('travis:js', 'Runs Javascript Travis CI tasks.', [ 'jshint', 'qunit:compiled' ]);
479+
grunt.registerTask('travis:phpunit', 'Runs PHPUnit Travis CI tasks.', 'phpunit');
477480

478481
// Patch task.
479482
grunt.renameTask('patch_wordpress', 'patch');

0 commit comments

Comments
 (0)