.travis.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. language: php
  2. dist: bionic
  3. php:
  4. - 7.1
  5. - 7.2
  6. - 7.3
  7. - 7.4
  8. cache:
  9. directories:
  10. - cache
  11. - vendor
  12. - $HOME/.composer/cache
  13. before_script:
  14. # Deactivate xdebug
  15. - phpenv config-rm xdebug.ini
  16. - composer install --ignore-platform-reqs
  17. script:
  18. - ./vendor/bin/phpunit
  19. jobs:
  20. include:
  21. - stage: Code style
  22. php: 7.2
  23. script:
  24. - ./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run
  25. - ./vendor/bin/phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n
  26. - stage: Coverage
  27. php: 7.2
  28. script:
  29. - pecl install pcov
  30. - composer require pcov/clobber --dev
  31. - ./vendor/bin/pcov clobber
  32. - ./vendor/bin/phpunit --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$