This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
101 lines (100 loc) · 3.23 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
sudo: false
dist: trusty
language: php
notifications:
email:
on_success: never
on_failure: change
cache:
directories:
- vendor
- $HOME/.composer/cache
after_success: bash bin/deploy.sh
env:
matrix:
- WP_VERSION=latest WP_MULTISITE=0
global:
- WP_TRAVISCI=travis:phpunit
- SVN_REPO: https://plugins.svn.wordpress.org/salmon/
- GH_REF: https://github.com/pfefferle/wordpress-salmon.git
- secure: "pFariSqLYqJxVIFdZSK5YtE5jJjaQIZJDi3oFARUlSg7p9NuZgpnRwymxPtbtEWVneLAj2h+qf85+cGAIY2J/SLIxQT2ZDdgeCySGSQxHKFDfqfHAfuw1u/I6GoUslDRG742dRLfEr5lXxXqnJPMDpZUSLodvkebqgpqkL5iMFYk9Lwqsu7geBmEh9ek9htNhuHEGJ3yNl6KbETqBTjSfNmXV/Ao151lYYeKarYOgxVSzSfrdKPS0y4UliNndF9fjaaVD3aaul2DEwIxYyH198RJFMRijLGruENFf9HuUthVI5TuLS1RalmdGFSWE73VOarDPK9xvKst+XHRRMJCzsjuSM9l60yRW5BhGel4K724gXtEOyS7L2SezYR+etPsYQeNii5q9nEDQTY0MIEKUd24Lipysmj4fkEvueazOomQzPgnlpZktTl+Yvk2hTWRSOXccgEA5S2hb9qTh8rhkQJQ5ExREAnZXKwhxIclcW1mkOLOXHvl6KPcYLfPBj0lZsA10L0aMOKJ/XVX2f5yrQzuSnrcSgoDCZ2QxnXWOUhOFnM7ugWq4CPjWz0w2bRRylg3h6gweOph5vNrl9gyLMa2HP+8HGHkJnmtRr0mkE8rl9o71vYgWLesziNQUdBiayR2TCfsQ4Sob0WJVg95rxAoET50bym96ly+bW8x6gE="
matrix:
include:
- php: 7.2
- php: 7.1
- php: 7.0
- php: 5.6
- php: 5.6
env: WP_PLUGIN_DEPLOY=1
before_script:
- |
# 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
- mysql --version
- phpenv versions
- php --version
- php -m
- which phpunit
- phpunit --version
- curl --version
- grunt --version
- git --version
- svn --version
- locale -a
before_install:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
if [[ ! -z "$WP_VERSION" ]] ; then
set -e
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
set +e
fi
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