.travis.yml 1.7 KB

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