.travis.yml 1.7 KB

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