felixarntz/wp-gcs-offload

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
sudo: false
language: php
cache:
  directories:
    - vendor
    - $HOME/.composer/cache
matrix:
  allow_failures:
    - php: hhvm
  include:
    - php: 7.0
      env: WP_VERSION=master WP_MULTISITE=1 PHPLINT=1 COVERAGE=1
    - php: 7.0
      env: WP_VERSION=4.5
    - php: 7.0
      env: WP_VERSION=4.4
    - php: 5.6
      env: WP_VERSION=4.5
    - php: 5.5
      env: WP_VERSION=4.5
    - php: 5.4
      env: WP_VERSION=4.5
    - php: hhvm
      env: WP_VERSION=4.5
before_script:
- phpenv local 5.6
- composer selfupdate 1.0.0 --no-interaction
- composer install --dev --no-interaction
- phpenv local --unset
- 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
script:
- if [[ "$PHPLINT" == "1" ]]; then find -L .  -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l; fi
- if [[ -z "$CODECLIMATE_REPO_TOKEN" ]]; then COVERAGE="0"; 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
notifications:
  email: false