mirror of
https://gh.wpcy.net/https://github.com/buddypress/buddypress.git
synced 2026-05-31 05:04:29 +08:00
Environment setup on Travis CI can fail in a number of ways - failed git checkouts, database connection problems, etc - that have nothing specifically to do with BuddyPress's test configuration. This changeset moves those steps into the before_install section, with the result that a failed setup routine will result in an 'errored' rather than 'failed' build. Grunt setup and the phpunit tests themselves will continue to generate failure messages when something goes wrong. See #5708 Props netweb git-svn-id: https://buddypress.svn.wordpress.org/trunk@8516 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
64 lines
1.9 KiB
YAML
64 lines
1.9 KiB
YAML
language: php
|
|
|
|
php:
|
|
- 5.2
|
|
- 5.3
|
|
- 5.4
|
|
- 5.5
|
|
|
|
# WordPress comes from the Git mirror, where 'master' mirrors svn 'trunk' and
|
|
# x.y mirrors the latest from the x.y branch
|
|
env:
|
|
- WP_VERSION=master
|
|
- WP_VERSION=3.9
|
|
- WP_VERSION=3.8
|
|
- WP_VERSION=3.7
|
|
|
|
matrix:
|
|
include:
|
|
- php: 5.6
|
|
env: WP_VERSION=master
|
|
allow_failures:
|
|
- php: 5.6
|
|
fast_finish: true
|
|
|
|
# before_install: Failures in this section will result in build status 'errored'
|
|
before_install:
|
|
# set up WP install
|
|
- export WP_DEVELOP_DIR=/tmp/wordpress/
|
|
- mkdir -p $WP_DEVELOP_DIR
|
|
- git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
|
|
- plugin_slug=$(basename $(pwd))
|
|
- plugin_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/$plugin_slug
|
|
- cd ..
|
|
- mv $plugin_slug $plugin_dir
|
|
# set up tests config
|
|
- cd $WP_DEVELOP_DIR
|
|
- echo $WP_DEVELOP_DIR
|
|
- cp wp-tests-config-sample.php wp-tests-config.php
|
|
- sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php
|
|
- sed -i "s/yourusernamehere/root/" wp-tests-config.php
|
|
- sed -i "s/yourpasswordhere//" wp-tests-config.php
|
|
# disable WP_DEBUG for PHP 5.5 due to ext/mysqli E_DEPRECATED errors
|
|
- if [[ "$TRAVIS_PHP_VERSION" == 5.5* ]] && [[ "$WP_VERSION" == "3.7" ]] ; then sed -i "s:define( 'WP_DEBUG://define( 'WP_DEBUG:" wp-tests-config.php; fi;
|
|
# set up database
|
|
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
|
|
# prepare for running the tests
|
|
- cd $plugin_dir
|
|
- npm install -g grunt-cli
|
|
|
|
# before_script: Failures in this section will result in build status 'errored'
|
|
before_script:
|
|
- npm install
|
|
|
|
# Run tests
|
|
script: grunt travis
|
|
|
|
notifications:
|
|
email: false
|
|
|
|
irc:
|
|
channels:
|
|
- "irc.freenode.net#buddypress-dev"
|
|
template:
|
|
- "Build %{build_number} (%{branch} - %{commit}): %{message} %{build_url}"
|