buddypress/.travis.yml
Mathieu Viet 78d9a439ec Travis : only test BuddyPress against WP < 5.1 with PHP 5.6
PHPUnit ^7 WordPress support was introduced in [https://core.trac.wordpress.org/changeset/44701/ WordPress 5.1]. For older versions of WordPress (4.9 & 5.0), let's use the specific `before_script` we're using to downgrade Composer PHPUnit dependency to its 5.7.27 version to be able to test PHP 5.6.

See #8381


git-svn-id: https://buddypress.svn.wordpress.org/trunk@12855 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
2021-03-02 04:29:17 +00:00

118 lines
3.6 KiB
YAML

# Travis CI Configuration File
# Use new Travis container-based infrastructure
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
os: linux
language: php
dist: trusty
cache:
apt: true
directories:
- $HOME/.composer/cache/files
- $HOME/.npm
- /tmp/node
git:
depth: 10
php:
- 7.3
- 7.2
# 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 BP_TRAVISCI=travis:phpunit
- WP_VERSION=5.7 BP_TRAVISCI=travis:phpunit
- WP_VERSION=5.6 BP_TRAVISCI=travis:phpunit
- WP_VERSION=5.5 BP_TRAVISCI=travis:phpunit
- WP_VERSION=5.4 BP_TRAVISCI=travis:phpunit
- WP_VERSION=5.3 BP_TRAVISCI=travis:phpunit
- WP_VERSION=5.2 BP_TRAVISCI=travis:phpunit
- WP_VERSION=5.1 BP_TRAVISCI=travis:phpunit
matrix:
include:
- php: 7.4
env: WP_VERSION=master BP_TRAVISCI=travis:phpunit
- php: 7.3
env: WP_VERSION=master BP_TRAVISCI=travis:grunt
- php: 7.3
env: WP_VERSION=master BP_TRAVISCI=travis:phpcompat
- php: 5.6
env: WP_VERSION=4.9 BP_TRAVISCI=travis:phpunit
- php: 5.6
env: WP_VERSION=5.0 BP_TRAVISCI=travis:phpunit
# 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
- |
# Remove Xdebug for a huge performance increase:
if [[ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]]; then
phpenv config-rm xdebug.ini
fi
# 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
# set up database
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
# prepare for running the tests
- cd $plugin_dir
# setup NodeJS version using NVM
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- node --version
- nvm install 14.15.0
- node --version
- npm install -g grunt-cli
- npm --version
- mysql --version
- phpenv versions
- php --version
- php -m
# The installed PHPUnit version does not support PHP 7.2 on trusty dist.
- if [[ ${TRAVIS_PHP_VERSION:0:3} != "7.2" ]]; then phpunit --version; fi
- curl --version
- grunt --version
- git --version
- svn --version
# before_script: Failures in this section will result in build status 'errored'
before_script:
- mkdir -p /tmp/node/node_modules
- ln -s /tmp/node/node_modules $plugin_dir/node_modules
- npm install
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then composer require --with-all-dependencies phpunit/phpunit:5.7.27; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} != "5.6" ]]; then composer install; fi
# Run tests
script: grunt $BP_TRAVISCI
notifications:
email: false
irc:
channels:
- secure: "Z+gAlyOafrw0Xg294np+7IpqOKTsswGjAWyOZsbzT7Xo8uY1nmz8tTuU50Gpo8jo5HQqG9G0QgI3zB3Cxy3M5dF+J5oLl1lBz1zL0mtHiq1HoXi2cbVnGCCpxtMvYII6UmPUGAg8zvNUQol+cw1jb3PzLwEDfGcDH64o/Z3j8Gg="
template:
- "Build %{build_number} (%{branch} - %{commit}): %{message} %{build_url}"
slack:
secure: JQT+HWoVhLzoG00HmJscYZO+Gy7ywnIlrUbCaI7DxFdFOIkKxsTLLq9cKE4y3VqgZAARTOKjP1eQ7a5OEg1vT11Ow+rB7iUAMNmITxXO4feTOx1i2673xRNBro/SZMhlLd7DY2erbMDZaG9hBQB4xLXRYOvP29pLxf5zTSyZMyE=