Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Install Dependencies
- #- apt-get update && apt-get install -y unzip zlib1g-dev libzip-dev nodejs npm git wget
- #- docker-php-ext-install zip
- # Install Composer
- #- curl -sS https://getcomposer.org/installer -o composer-setup.php
- #- php composer-setup.php --install-dir=/usr/local/bin --filename=composer
- # Install Composer dependencies.
- if [[ ( "$SNIFF" == "1" ) || ( "$UNIT" == "1" ) || ( "$INTEGRATION" == "1" ) ]]; then
- composer install --no-progress;
- fi
- # Install NPM dependencies.
- #- |
- # if [[ ( "$SNIFF" == "1" ) || ( "$TEST_GULP" == "1" ) ]]; then
- # npm install --no-progress;
- # fi
- # Speed up build time by disabling Xdebug.
- #- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
- # Pull in the WP Core jshint rules.
- if [[ "$SNIFF" == "1" ]]; then
- wget https://develop.svn.wordpress.org/trunk/.jshintrc;
- fi
- # Setup WordPress core test suite for integration.
- if [[ "$INTEGRATION" == "1" ]]; then
- service mysql start
- if [[ "$WP_VERSION" == "latest" ]]; then
- curl -s http://api.wordpress.org/core/version-check/1.7/ > /tmp/wp-latest.json
- WP_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//')
- fi
- THEME_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 "$THEME_SLUG" "/tmp/wordpress/src/wp-content/themes/$THEME_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/themes/$THEME_SLUG"
- fi
- # After setup you should refresh your path.
- # - phpenv rehash;
- # Search for PHP syntax errors.
- find -L . -name '*.php' ! -path "*/vendor/*" -print0 | xargs -0 -n 1 -P 4 php -l
- # Check the theme against WordPress Coding Standards.
- if [[ "$SNIFF" == "1" ]]; then
- composer run-script phpcs-dev
- fi
- # Run the theme through JavaScript Code Style checker.
- if [[ "$SNIFF" == "1" ]]; then
- /usr/local/bin/eslint --resolve-plugins-relative-to=/usr/local/lib/node_modules .;
- fi
- # Run the unit tests.
- if [[ "$UNIT" == "1" ]]; then
- composer run-script phpunit-dev
- fi
- # Run the integration tests.
- if [[ "$INTEGRATION" == "1" ]]; then
- composer run-script phpunit-integration-dev
- fi
- # Run the gulp tests.
- if [[ "$TEST_GULP" == "1" ]]; then
- npm install --no-progress gulp
- npm run lint:gulp
- npm run test:gulp
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement