.travis.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. language: php
  2. dist: trusty
  3. php:
  4. - 5.6
  5. - 7.0
  6. - 7.1
  7. - 7.2
  8. - 7.3
  9. cache:
  10. directories:
  11. - cache
  12. - vendor
  13. - $HOME/.composer/cache
  14. before_script:
  15. # Deactivate xdebug
  16. - if [ -z "$KEEP_XDEBUG" ]; then rm -rfv /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ; fi
  17. - composer install --ignore-platform-reqs
  18. script:
  19. - ./vendor/bin/phpunit
  20. jobs:
  21. include:
  22. - stage: Code style
  23. php: 7.2
  24. script:
  25. - ./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run
  26. - ./vendor/bin/phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n
  27. - stage: Coverage
  28. php: 7.2
  29. env: KEEP_XDEBUG=1
  30. script:
  31. - travis_wait 40 ./vendor/bin/phpunit --debug --coverage-clover coverage-clover.xml
  32. after_script:
  33. - wget https://scrutinizer-ci.com/ocular.phar
  34. - php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml
  35. - stage: API documentation
  36. php: 7.2
  37. before_script:
  38. - curl -O https://get.sensiolabs.org/sami.phar
  39. script:
  40. - git fetch origin master:master
  41. - git fetch origin --tags
  42. - php sami.phar update .sami.php
  43. - echo '<html><head><meta http-equiv="Refresh" content="0; url=master/"></head><body><p>If you are not automatically redirected, please go to <a href="master/">the latest stable API documentation</a>.</p></body></html>' > build/index.html
  44. deploy:
  45. provider: pages
  46. skip-cleanup: true
  47. local-dir: build
  48. github-token: $GITHUB_TOKEN
  49. on:
  50. all_branches: true
  51. condition: $TRAVIS_BRANCH =~ ^master$