kai-jacobsen/kontentblocks

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: php

php: '5.6'

sudo: false
addons:
    code_climate:
        repo_token: 7f1b407be97ef1daa00d48b2ff2237ba79752c18d8cf8bdb887b780db2d7a384
env:
  - WP_VERSION=master WP_MULTISITE=0

matrix:
  include:
    - php: '7.2'
      env: WP_VERSION=5.0 WP_MULTISITE=0
    - php: '7.1'
      env: WP_VERSION=4.9 WP_MULTISITE=0
    - php: '7.0'
      env: WP_VERSION=4.9 WP_MULTISITE=0
    - php: '7.0'
      env: WP_VERSION=4.8 WP_MULTISITE=0
    - php: '7.0'
      env: WP_VERSION=4.7 WP_MULTISITE=0
    - php: '5.6'
      env: WP_VERSION=4.7 WP_MULTISITE=0
before_install: npm install -g grunt-cli

before_script:
  - PLUGIN_SLUG=$(basename $(pwd))
  - export WP_DEVELOP_DIR=/tmp/wordpress/tests/phpunit/
  - export CODECLIMATE_REPO_TOKEN=7f1b407be97ef1daa00d48b2ff2237ba79752c18d8cf8bdb887b780db2d7a384
  - git clone --depth=50 --branch="$WP_VERSION" git://develop.git.wordpress.org/ /tmp/wordpress
  - composer self-update
  - composer install
  - 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
  - phpunit --version
  - cd "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG"

script:
  - php vendor/bin/phpunit -c phpunit.xml --coverage-clover build/logs/clover.xml