.travis.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. env:
  2. global:
  3. - CC_TEST_REPORTER_ID=4eed0d135b9e1a1668a68e5e29cc71faf872937d13c42efa4faf42dad5ed3375
  4. language: php
  5. php:
  6. - 5.6
  7. - 7.0
  8. - 7.1
  9. - 7.2
  10. - 7.3
  11. env:
  12. - phpunitflags="--stop-on-failure --exclude-group=live"
  13. matrix:
  14. fast_finish: true
  15. include:
  16. - php: 5.6
  17. dist: xenial
  18. env:
  19. - lint="php-cs-fixer"
  20. - phpunitflags="do not run"
  21. - php: 7.4
  22. dist: bionic
  23. env:
  24. - analysis=yes
  25. - phpunitflags="do not run"
  26. - php: 7.4
  27. dist: bionic
  28. env:
  29. - lint=no
  30. - coverage=yes
  31. - phpunitflags="--stop-on-failure --coverage-clover=clover.xml"
  32. cache:
  33. directories:
  34. - ./vendor
  35. - ./psalm/cache
  36. before_script:
  37. - if [[ "$coverage" != "yes" ]]; then phpenv config-rm xdebug.ini; fi
  38. - composer install --no-interaction
  39. - if [[ "$coverage" = "yes" ]]; then curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; fi
  40. - if [[ "$coverage" = "yes" ]]; then chmod +x ./cc-test-reporter; fi
  41. - if [[ "$coverage" = "yes" ]]; then ./cc-test-reporter before-build; fi
  42. - if [[ "$analysis" = "yes" ]]; then composer require --dev paragonie/hidden-string; fi
  43. - if [[ "$analysis" = "yes" ]]; then composer require --dev --update-with-dependencies "phpunit/phpunit:<9" vimeo/psalm psalm/plugin-phpunit maglnet/composer-require-checker:^2.0; fi
  44. script:
  45. - if [[ "$lint" != "no" ]]; then vendor/bin/parallel-lint .php_cs.dist src tests examples; fi
  46. - if [[ "$phpunitflags" != "do not run" ]]; then vendor/bin/phpunit $phpunitflags; fi
  47. - if [[ "$analysis" = "yes" ]]; then vendor/bin/composer-require-checker check ./composer.json; fi
  48. - if [[ "$analysis" = "yes" ]]; then vendor/bin/psalm --show-info=false --shepherd --diff --diff-methods; fi
  49. - if [[ "$lint" = "php-cs-fixer" ]]; then vendor/bin/php-cs-fixer fix --allow-risky=yes --no-interaction --dry-run --diff-format=udiff -v; fi
  50. after_script:
  51. - if [[ "$coverage" = "yes" ]]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT -t clover; fi