.travis.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. - vendor
  11. - $HOME/.composer/cache
  12. before_script:
  13. # Deactivate xdebug
  14. - phpenv config-rm xdebug.ini
  15. - composer install --ignore-platform-reqs
  16. script:
  17. - ./vendor/bin/phpunit
  18. jobs:
  19. include:
  20. - stage: Code style
  21. php: 7.2
  22. script:
  23. - ./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run
  24. - ./vendor/bin/phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n
  25. - stage: Coverage
  26. php: 7.2
  27. script:
  28. - pecl install pcov
  29. - composer require pcov/clobber --dev
  30. - ./vendor/bin/pcov clobber
  31. - ./vendor/bin/phpunit --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 documentations
  36. if: tag is present
  37. php: 7.4
  38. before_script:
  39. - curl -O https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.0.0-rc/phpDocumentor.phar
  40. script:
  41. - php phpDocumentor.phar --directory src/ --target docs/api
  42. deploy:
  43. provider: pages
  44. skip-cleanup: true
  45. local-dir: docs/api
  46. github-token: $GITHUB_TOKEN
  47. on:
  48. all_branches: true
  49. condition: $TRAVIS_BRANCH =~ ^master$