language: php

php:
  - 7.1
  - 7.2
  - nightly

matrix:
  allow_failures:
    - php: nightly

install:
      - travis_retry composer install --no-interaction --ignore-platform-reqs

script:
    - mkdir -p build/logs
    - mkdir -p build/coverage
    - ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml

after_script:
    - if [ -f build/logs/clover.xml ]; then ./vendor/bin/coveralls  -v; fi;

notifications:
  email:
      - swansoft_team@groups.163.com

dist: trusty
sudo: false
language: php

php:
  - 7.1
  - 7.2
  - nightly

cache:
  directories:
    - $HOME/.composer/cache

before_install:
  - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
  - composer self-update

install: travis_retry composer install --no-interaction

script: ./vendor/bin/phpunit

jobs:
  allow_failures:
    - php: nightly

  include:
    - stage: Test
      env: COVERAGE_ENABLED=1
      before_script:
        - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
        - if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
        - mkdir -p build/logs
        - mkdir -p build/coverage
      script:
        - ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
      after_script:
        - ./vendor/bin/coveralls  -v

notifications:
  email:
      - swansoft_team@groups.163.com

Use new Travis-CI build stages
Use new Travis-CI build stages

To simplify the management of builds and also be able to define
dependencies.
