Skip to content

Commit

Permalink
Merge pull request #206 from Yoast/JRF/QA/travis-remove-wp-download
Browse files Browse the repository at this point in the history
Travis/Unit tests: remove WP download
  • Loading branch information
Alexander Botteram authored May 22, 2019
2 parents 17d3f2a + 161e734 commit 1f720df
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,21 @@ matrix:
fast_finish: true
include:
- php: 7.3
env: WP_VERSION=5.0 WP_MULTISITE=1 PHPCS=1 CHECKJS=1 PHPUNIT=1 SECURITY=1 TRAVIS_NODE_VERSION=node
env: PHPCS=1 CHECKJS=1 PHPUNIT=1 SECURITY=1 TRAVIS_NODE_VERSION=node
- php: 5.2
dist: precise
- php: 5.3
dist: precise
- php: 5.6
env: PHPUNIT=1 WP_VERSION=4.8
env: PHPUNIT=1
- php: 7.0
env: PHPUNIT=1 WP_VERSION=4.9
env: PHPUNIT=1
- php: "7.4snapshot"
env: PHPUNIT=1 WP_VERSION=master
env: PHPUNIT=1

allow_failures:
# Allow failures for unstable builds.
- php: "7.4snapshot"
- env: WP_VERSION=master

before_install:
- export SECURITYCHECK_DIR=/tmp/security-checker
Expand All @@ -51,24 +50,6 @@ install:
- if [[ "$CHECKJS" == "1" ]]; then yarn install; fi
- if [[ "$SECURITY" == "1" ]]; then wget -P $SECURITYCHECK_DIR https://get.sensiolabs.org/security-checker.phar && chmod +x $SECURITYCHECK_DIR/security-checker.phar;fi

before_script:
- |
if [[ "$PHPUNIT" == "1" ]]; then
PLUGIN_SLUG=$(basename $(pwd))
export WP_DEVELOP_DIR=/tmp/wordpress/
git clone --depth=50 --branch="$WP_VERSION" git://develop.git.wordpress.org/ /tmp/wordpress
cd ..
cp -r "$PLUGIN_SLUG" "/tmp/wordpress/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 "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG"
phpenv rehash
fi
script:
# Exclude tests directory from linting for PHP 5.2/3
- if [[ $TRAVIS_PHP_VERSION == "5.2" || $TRAVIS_PHP_VERSION == "5.3" ]]; then if find -L . -path ./vendor -prune -o -path ./node_modules -prune -o -path ./tests -prune -o -name '*.php' -exec php -l {} \; | grep "^[Parse error|Fatal error]"; then exit 1; fi; fi
Expand Down

0 comments on commit 1f720df

Please sign in to comment.