forked from codesnippetspro/code-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
83 lines (71 loc) · 2.46 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
# Declare project language.
# @link http://about.travis-ci.org/docs/user/languages/php/
language: php
# Declare versions of PHP to use. Use one decimal max.
php:
- "5.5"
- "5.4"
- "5.3"
env:
# Trunk
# @link https://github.com/WordPress/WordPress
- WP_VERSION=master WP_MULTISITE=0
- WP_VERSION=master WP_MULTISITE=1
# WordPress 4.2 (latest stable version)
# @link https://github.com/WordPress/WordPress/tree/4.2-branch
- WP_VERSION=4.2 WP_MULTISITE=0
- WP_VERSION=4.2 WP_MULTISITE=1
# Declare 5.6 beta in test matrix.
# @link http://docs.travis-ci.com/user/build-configuration/
matrix:
include:
- php: 5.6
env: WP_VERSION=master
allow_failures:
- php: 5.6
- php: 5.2
fast_finish: true
# Prepare the system by installing prerequisites and dependencies.
# Failures in this section will result in build status 'errored'.
before_install:
- composer self-update
- npm install -g grunt-cli
# Prepare your build for testing.
# Failures in this section will result in build status 'errored'.
before_script:
# Run Grunt and Composer
- composer self-update
- composer install
- npm install
# Register WPCS with PHPCS (doesn't seem to do this automatically)
- vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs
# 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/
# Set up plugin information.
- plugin_slug=$(basename $(pwd))
- plugin_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/$plugin_slug
- cd ..
- ls -l
- mv $plugin_slug $WP_DEVELOP_DIR/src/wp-content/plugins
# Set up WordPress configuration.
- 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
# Create WordPress database.
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
# Change into plugin directory.
- cd $plugin_dir
# Run test script commands
# Default is specific to project language.
# All commands must exit with code 0 on success. Anything else is considered failure.
script:
# Search for PHP syntax errors.
- find . -maxdepth 1 \( -name '*.php' \) -exec php -lf {} \;
- find includes \( -name '*.php' \) -exec php -lf {} \;
# Run Grunt tests
- grunt test