wordpress-activitypub/.travis.yml

113 lines
3.3 KiB
YAML
Raw Normal View History

2018-11-05 22:20:20 +01:00
sudo: false
dist: trusty
2018-09-24 20:53:23 +02:00
language: php
notifications:
email:
on_success: never
on_failure: change
2018-11-05 22:20:20 +01:00
cache:
directories:
- vendor
- $HOME/.composer/cache
2018-09-24 20:53:23 +02:00
after_success: bash bin/deploy.sh
env:
matrix:
2018-11-05 22:20:20 +01:00
- WP_VERSION=latest WP_MULTISITE=0
2018-09-24 20:53:23 +02:00
global:
2018-11-05 22:20:20 +01:00
- WP_TRAVISCI=travis:phpunit
- SVN_REPO: https://plugins.svn.wordpress.org/activitypub/
- GH_REF: https://github.com/pfefferle/wordpress-activitypub.git
2018-11-06 11:28:59 +01:00
- secure: "AgeB9Snw4AQqjvWEVavwcvhzQOFHEurl+W08DRh0HilCZEuBNiTRf0V8ExOSjgxcL/bxVoagC9499XcRXKR2S7YjFzAXRAOTbdey8z1I2RWHmdRIKACsgm95uT6arlOAoKPXk3Tp+Ykj591Zw8zVfrhnu81qyTcJSmGk4zphDWwgOiyE8bmXLDA02fPVhB0YnGG07P0HwdmCEwkXIMqJWs8j5vDoJhXFcaaOkywCOgjbwmNtoOJpwURiO19udBrQHDF4ujCxGbzzVhsyMjSjy2GFGC8SO5ZvvoZJL0x+m/1yZfJa1MVcOFuwTFbdJrV04k2bnYeTo5LXy3whg94FdNr32e50hzchDrBPmjYhoUT4/9yBP0okyH/e5M/tahulB2zxEfY1wfbUZjQXbCWOJM6330hnyic5hs1Q3z2LlWCszkZ+sfRwNsGFQOQD+6MXPkwBobgC+sQaQYanT8w9J0Dx2dsgEkMmcrxbdvQ8rohJ6qAza6/t6+8cU9AGfeEzZg7O1SlGN1R1vTFjHhlElF6Fwb+1Tgdq18Iu6sFGKkmgGgjn2lXQlTgcHASgUoYaGrf8h7ZcuLj3WmEIhhoZXetRp1CPE76kPpb19Zf3BYjrMwReaMCxSfTfrEEYh+BYmwjixQFrQgOL9pW60YEq1QZiMufrKBeeAoCB1q7mHyo="
2018-09-24 20:53:23 +02:00
matrix:
include:
2018-11-05 22:20:20 +01:00
- php: 7.2
- php: 7.1
- php: 7.0
- php: 5.6
- php: 5.6
env: WP_PLUGIN_DEPLOY=1
- php: 5.5
- php: 5.4
- php: 5.3
dist: precise
2018-09-24 20:53:23 +02:00
before_script:
2018-11-05 22:20:20 +01:00
- |
# 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
else
echo "xdebug.ini does not exist"
fi
- |
# Export Composer's global bin dir to PATH:
composer config --list --global
export PATH=`composer config --list --global | grep '\[home\]' | { read a; echo "${a#* }/vendor/bin:$PATH"; }`
- |
# Install the specified version of PHPUnit depending on the PHP version:
if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
case "$TRAVIS_PHP_VERSION" in
7.2|7.1|7.0|nightly)
echo "Using PHPUnit 6.x"
composer global require "phpunit/phpunit:^6"
;;
5.6|5.5|5.4|5.3)
echo "Using PHPUnit 4.x"
composer global require "phpunit/phpunit:^4"
;;
5.2)
# Do nothing, use default PHPUnit 3.6.x
echo "Using default PHPUnit, hopefully 3.6"
;;
*)
echo "No PHPUnit version handling for PHP version $TRAVIS_PHP_VERSION"
exit 1
;;
esac
fi
if [[ "$WP_TRAVISCI" == "travis:phpcs" ]] ; then
composer install
fi
2018-11-05 22:07:12 +01:00
2018-11-05 22:20:20 +01:00
- mysql --version
- phpenv versions
- php --version
- php -m
- which phpunit
- phpunit --version
- curl --version
- grunt --version
- git --version
- svn --version
- locale -a
2018-11-05 22:07:12 +01:00
before_install:
2018-11-05 22:20:20 +01:00
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
2018-11-05 22:07:12 +01:00
if [[ ! -z "$WP_VERSION" ]] ; then
set -e
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
set +e
2018-09-24 20:53:23 +02:00
fi
2018-11-05 22:07:12 +01:00
script:
- |
if [[ ! -z "$WP_VERSION" ]] ; then
# Run the build because otherwise there will be a bunch of warnings about
# failed `stat` calls from `filemtime()`.
echo Running with the following versions:
php -v
phpunit --version
# Run PHPUnit tests
phpunit || exit 1
WP_MULTISITE=1 phpunit || exit 1
fi
- |
if [[ "$WP_TRAVISCI" == "travis:phpcs" ]] ; then
./vendor/bin/phpcs -p -s -v -n --standard=./phpcs.ruleset.xml --extensions=php
fi