language: php

php:
  - 7.0
  - 7.1
  - 7.2
  - nightly

sudo: false

env:
  global:
    - OCULAR_BIN=$HOME/.bin/ocular.phar

matrix:
  fast_finish: true
  include:
    - php: '7.2'
      env:
        - COVERAGE="true"
        - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
  allow_failures:
    - php: nightly
    - php: 7.0

before_install:
  - |
    if [ -n "$COVERAGE" ]; then
      if [ ! -e $OCULAR_BIN ]; then
          wget https://scrutinizer-ci.com/ocular.phar -O $OCULAR_BIN
          chmod +x $OCULAR_BIN
          alias ocular="php $OCULAR_BIN"
      fi
    fi

install:
  - composer update

script:
  - vendor/bin/phpcs --config-set installed_paths "../../wp-coding-standards/wpcs/,../../automattic/phpcs-neutron-standard/,../../inpsyde/php-coding-standards/,../../wimg/php-compatibility/,../../pheromone/phpcs-security-audit/Security/"
  - vendor/bin/phpcs -n
  - vendor/bin/phpunit

after_script:
  - if [ -n "$COVERAGE" ]; then $OCULAR_BIN code-coverage:upload --format=php-clover coverage.xml; fi

notifications:
  email: false

language: php

php:
  - 7.0
  - 7.1
  - 7.2
  - nightly

sudo: false

env:
  global:
    - OCULAR_BIN=$HOME/.bin/ocular.phar

matrix:
  fast_finish: true
  include:
    - php: '7.2'
      env:
        - COVERAGE="true"
        - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
  allow_failures:
    - php: nightly
    - php: 7.0

before_install:
  - |
    if [ -n "$COVERAGE" ]; then
      if [ ! -e $OCULAR_BIN ]; then
          wget https://scrutinizer-ci.com/ocular.phar -O $OCULAR_BIN
          chmod +x $OCULAR_BIN
          alias ocular="php $OCULAR_BIN"
      fi
    fi

install:
  - composer update

script:
  - vendor/bin/phpcs --config-set installed_paths "../../wp-coding-standards/wpcs/,../../automattic/phpcs-neutron-standard/,../../inpsyde/php-coding-standards/,../../wimg/php-compatibility/,../../pheromone/phpcs-security-audit/Security/"
  - vendor/bin/phpcs -n
  - vendor/bin/phpunit

after_script:
  - if [ -n "$COVERAGE" ]; then $OCULAR_BIN code-coverage:upload --format=php-clover coverage.xml; fi

notifications:
  email: false

Set xml format for coverage file
Set xml format for coverage file
