This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
.travis.yml
57 lines (47 loc) · 1.91 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
sudo: false
language: php
branches:
only:
- master
matrix:
fast_finish: true
include:
- php: '5.6'
env: WP_VERSION=master PHP_LINT=1 WP_PHPCS=1
- php: '5.6'
env: WP_VERSION=4.8
- php: '5.6'
env: WP_VERSION=4.7
- php: '7.0'
env: WP_VERSION=master PHP_LINT=1
- php: '7.0'
env: WP_VERSION=4.8
- php: '7.0'
env: WP_VERSION=4.7
- php: 'hhvm'
env: WP_VERSION=master PHP_LINT=1
allow_failures:
- php: 'hhvm'
before_script:
- export WP_TESTS_DIR=/tmp/wordpress/tests/phpunit
- export WP_CORE_DIR=/tmp/wordpress/src/
- git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ /tmp/wordpress
- mysql -e "CREATE DATABASE wordpress_tests;" -uroot
- cp /tmp/wordpress/wp-tests-config-sample.php /tmp/wordpress/wp-tests-config.php
- sed -i "s/youremptytestdbnamehere/wordpress_tests/" /tmp/wordpress/wp-tests-config.php
- sed -i "s/yourusernamehere/travis/" /tmp/wordpress/wp-tests-config.php
- sed -i "s/yourpasswordhere//" /tmp/wordpress/wp-tests-config.php
- |
if [[ "$WP_PHPCS" == "1" ]]; then
git clone --depth=1 --branch=2.9 https://github.com/squizlabs/PHP_CodeSniffer.git /tmp/php-codesniffer
git clone --depth=1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git --branch master /tmp/wordpress-coding-standards
/tmp/php-codesniffer/scripts/phpcs --config-set installed_paths /tmp/wordpress-coding-standards
phpenv rehash
fi
script:
- if [[ "$PHP_LINT" == "1" ]]; then find . -type "f" -iname "*.php" | xargs -L "1" php -l; fi
- if [[ "$WP_PHPCS" == "1" ]]; then /tmp/php-codesniffer/scripts/phpcs -p -s -v -n --standard=./phpcs.ruleset.xml; fi
- export WP_MULTISITE=0 && phpunit
- export WP_MULTISITE=1 && phpunit
notifications:
email: false