Skip to content

Commit 51dddef

Browse files
author
Felix Arntz
committed
Only setup WordPress on Travis when not running NPM tests.
1 parent 7f80db0 commit 51dddef

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

.travis.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,22 @@ before_script:
8181
composer install
8282
cd ..
8383
fi
84-
- PLUGIN_SLUG=$(basename $(pwd))
85-
- export WP_DEVELOP_DIR=/tmp/wordpress/
86-
- git clone --depth=50 --branch="$WP_VERSION" git://develop.git.wordpress.org/ /tmp/wordpress
87-
- cd ..
88-
- cp -r "$PLUGIN_SLUG" "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG"
89-
- cd /tmp/wordpress/
90-
- cp wp-tests-config-sample.php wp-tests-config.php
91-
- sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
92-
- sed -i "s/yourusernamehere/travis/" wp-tests-config.php
93-
- sed -i "s/yourpasswordhere//" wp-tests-config.php
94-
- mysql -e "CREATE DATABASE wordpress_tests;" -uroot
95-
- cd "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG"
96-
- phpenv rehash
84+
- |
85+
if [[ "$NPM_TESTS" != "1" ]]; then
86+
PLUGIN_SLUG=$(basename $(pwd))
87+
export WP_DEVELOP_DIR=/tmp/wordpress/
88+
git clone --depth=50 --branch="$WP_VERSION" git://develop.git.wordpress.org/ /tmp/wordpress
89+
cd ..
90+
cp -r "$PLUGIN_SLUG" "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG"
91+
cd /tmp/wordpress/
92+
cp wp-tests-config-sample.php wp-tests-config.php
93+
sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
94+
sed -i "s/yourusernamehere/travis/" wp-tests-config.php
95+
sed -i "s/yourpasswordhere//" wp-tests-config.php
96+
mysql -e "CREATE DATABASE wordpress_tests;" -uroot
97+
cd "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG"
98+
phpenv rehash
99+
fi
97100
script:
98101
- |
99102
if [[ "$NPM_TESTS" == "1" ]]; then

0 commit comments

Comments
 (0)