-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
46 lines (43 loc) · 1.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
language: php
## PHP versions to test against
php:
- "7.1"
- "7.0"
- "5.6"
- "5.5"
- "5.4"
- "5.3"
- "5.2"
sudo: false
env:
- WP_VERSION=master WP_MULTISITE=0
install:
- . $HOME/.nvm/nvm.sh
- nvm install stable
- nvm use stable
- npm install
- npm install grunt-cli -g
before_script:
## Install the wordpress latest version
- 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
- theme_slug=$(basename $(pwd))
- theme_dir=$WP_DEVELOP_DIR/src/wp-content/themes/$theme_slug
- cd ..
- mv $theme_slug $theme_dir
- cd $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
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
## install PHPCS and Wordpress standards
- pear install pear/PHP_CodeSniffer-2.9.0
- mkdir wordpress-coding-standards && curl -L https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/master.tar.gz | tar xz --strip-components=1 -C wordpress-coding-standards
- phpenv rehash
- phpcs --config-set installed_paths $WP_DEVELOP_DIR/wordpress-coding-standards
- phpenv rehash
- cd $theme_dir
script:
grunt travis