language: php
php:
  - '5.6'
  - '7.2'

# 项目所在分支
branches:
  only:
  - master

install:
  - composer install --prefer-dist --optimize-autoloader --quiet

before_script:
  - cd tests/
  - git clone -b gh-pages https://github.com/actors315/DI.git tests/
  - cd ..

script:
  - ./vendor/bin/phpunit --coverage-html=./tests/tests/$(phpenv version-name)/

deploy:
  provider: pages
  skip-cleanup: true
  keep-history: true
  github-token: $GITHUB_ACCESS_TOKEN
  target-branch: gh-pages
  local_dir: tests/tests/
  on:
    branch: master

after_success:
 - git push https://actors315:$GITEE_COM_TOKEN@gitee.com/actors315/DI.git --all
