forked from ryan-was/wpseo-news
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
77 lines (69 loc) · 2.34 KB
/
.travis.yml
File metadata and controls
77 lines (69 loc) · 2.34 KB
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
language: php
sudo: false
matrix:
include:
- php: 7.0
env: WP_VERSION=master WP_MULTISITE=1 PHPLINT=1
- php: 5.2
env: WP_VERSION=4.4 WP_MULTISITE=1 PHPLINT=1
- php: 7.0
env: WP_VERSION=4.4
- php: 7.0
env: WP_VERSION=4.3
- php: 5.6
env: WP_VERSION=4.2
- php: 5.6
env: WP_VERSION=4.1
- php: 5.6
env: WP_VERSION=4.0
- php: 5.6
env: WP_VERSION=4.4
- php: 5.5
env: WP_VERSION=4.4
- php: 5.4
env: WP_VERSION=4.4
- php: 5.3
env: WP_VERSION=4.4
- php: hhvm
env: WP_VERSION=4.4
cache:
directories:
- vendor
- $HOME/.composer/cache
before_script:
- PLUGIN_SLUG=$(basename $(pwd))
- export WP_DEVELOP_DIR=/tmp/wordpress/
# Clone WordPress
#
- git clone --depth=50 --branch="$WP_VERSION" git://develop.git.wordpress.org/ /tmp/wordpress
# Clone WPSEO and its submodule
#
- git clone --depth=50 --branch="trunk" https://github.com/Yoast/wordpress-seo.git $WP_DEVELOP_DIR/src/wp-content/plugins/wordpress-seo
- cd /tmp/wordpress/src/wp-content/plugins/wordpress-seo
- phpenv local 5.6
- composer selfupdate --no-interaction
- composer install --no-interaction
- phpenv local --unset
- cd -
# Copy news seo to test dir
- cd ..
- cp -r "$PLUGIN_SLUG" "$WP_DEVELOP_DIR/src/wp-content/plugins/$PLUGIN_SLUG"
- cd /tmp/wordpress/
- cp wp-tests-config-sample.php wp-tests-config.php
- sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
- sed -i "s/yourusernamehere/travis/" wp-tests-config.php
- sed -i "s/yourpasswordhere//" wp-tests-config.php
- mysql -e "CREATE DATABASE wordpress_tests;" -uroot
- cd "$WP_DEVELOP_DIR/src/wp-content/plugins/$PLUGIN_SLUG"
- phpenv local 5.6
- composer install --no-interaction
- composer config-yoastcs
- phpenv local --unset
- phpenv rehash
script:
- if [[ "$PHPLINT" == "1" ]]; then find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l; fi
- if [[ "$PHPLINT" == "1" ]]; then vendor/bin/phpcs -p -s -v -n . --standard=./codesniffer.xml --extensions=php; fi
- if [[ "$CHECKS" == "1" ]]; then npm install -g grunt-cli && npm install --no-optional && grunt check:js; fi
- if [[ "$COVERAGE" == "1" ]]; then phpunit -c phpunit.xml --coverage-clover build/logs/clover.xml; else phpunit -c phpunit.xml; fi
- if [[ "$COVERAGE" == "1" ]]; then vendor/bin/test-reporter; fi
- phpunit -c phpunit.xml