.travis.yml 1.7 KB

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