forked from xwp/stream
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
38 lines (33 loc) · 1.83 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
language:
- php
- node_js
php:
- 5.3
- 5.4
node_js:
- 0.10
env:
- WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=latest WP_MULTISITE=1
- WP_VERSION=3.7 WP_MULTISITE=0
- WP_VERSION=3.7 WP_MULTISITE=1
before_script:
- export WP_TESTS_DIR=/tmp/wordpress-tests/
- export PLUGIN_DIR=$(pwd)
- export PLUGIN_SLUG=$(basename $(pwd) | sed 's/^wp-//')
- export PHPCS_DIR=/tmp/phpcs
- export PHPCS_GITHUB_SRC=squizlabs/PHP_CodeSniffer
- export PHPCS_GIT_TREE=master
- export WPCS_GITHUB_SRC=WordPress-Coding-Standards/WordPress-Coding-Standards
- export WPCS_GIT_TREE=master
- export WPCS_STANDARD=$(if [ -e phpcs.ruleset.xml ]; then echo phpcs.ruleset.xml; else echo WordPress; fi)
- if [ -e .ci-env.sh ]; then source .ci-env.sh; fi
- if [ -e phpunit.xml ] || [ -e phpunit.xml.dist ]; then wget -O /tmp/install-wp-tests.sh https://raw.githubusercontent.com/wp-cli/wp-cli/master/templates/install-wp-tests.sh; bash /tmp/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION; cd /tmp/wordpress/wp-content/plugins; ln -s $PLUGIN_DIR $PLUGIN_SLUG; cd $PLUGIN_DIR; fi
- mkdir -p $PHPCS_DIR && curl -L https://github.com/$PHPCS_GITHUB_SRC/archive/$PHPCS_GIT_TREE.tar.gz | tar xvz --strip-components=1 -C $PHPCS_DIR
- mkdir -p $PHPCS_DIR/CodeSniffer/Standards/WordPress && curl -L https://github.com/$WPCS_GITHUB_SRC/archive/$WPCS_GIT_TREE.tar.gz | tar xvz --strip-components=1 -C $PHPCS_DIR/CodeSniffer/Standards/WordPress
- npm install -g jshint
script:
- find . -path ./bin -prune -o \( -name '*.php' -o -name '*.inc' \) -exec php -lf {} \;
- if [ -e phpunit.xml ] || [ -e phpunit.xml.dist ]; then phpunit; fi
- $PHPCS_DIR/scripts/phpcs --standard=$WPCS_STANDARD $(if [ -n "$PHPCS_IGNORE" ]; then echo --ignore=$PHPCS_IGNORE; fi) $(find . -name '*.php')
- jshint .