.travis.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. dist: xenial
  2. os: linux
  3. language: php
  4. git:
  5. depth: 10
  6. cache:
  7. directories:
  8. - $HOME/.composer
  9. - $HOME/bin
  10. env:
  11. global:
  12. - DEFAULT_COMPOSER_FLAGS="--optimize-autoloader --no-interaction --no-progress"
  13. - COMPOSER_FLAGS=""
  14. before_install:
  15. # turn off XDebug
  16. - phpenv config-rm xdebug.ini || return 0
  17. jobs:
  18. include:
  19. -
  20. stage: Test
  21. php: 7.4
  22. name: 7.4 | Collect coverage
  23. before_install:
  24. # for building a tag release we don't need to collect code coverage
  25. - if [ $TRAVIS_TAG ]; then travis_terminate 0; fi
  26. ## regular `before_install`
  27. # turn off XDebug
  28. - phpenv config-rm xdebug.ini || return 0
  29. # Require PHPUnit 8
  30. - composer require --dev --no-update phpunit/phpunit:^8
  31. # Install PCOV
  32. - pecl install pcov
  33. install:
  34. - travis_retry composer update $DEFAULT_COMPOSER_FLAGS $COMPOSER_FLAGS
  35. - composer info -D | sort
  36. before_script:
  37. # Make code compatible with PHPUnit 8
  38. - PHP_CS_FIXER_FUTURE_MODE=1 php php-cs-fixer fix --rules=void_return -q tests || return 0
  39. script:
  40. - vendor/bin/phpunit --testsuite coverage --exclude-group covers-nothing --coverage-clover build/logs/clover.xml || travis_terminate 1
  41. - php vendor/bin/php-coveralls -v
  42. -
  43. stage: Deployment
  44. php: 7.4
  45. install: ./dev-tools/build.sh
  46. script:
  47. - PHP_CS_FIXER_TEST_ALLOW_SKIPPING_SMOKE_TESTS=0 vendor/bin/phpunit tests/Smoke/
  48. before_deploy:
  49. # ensure that deployment is happening only if tag matches version of PHP CS Fixer
  50. - test $(php dev-tools/info-extractor.php | jq .version.vnumber) == "\"$TRAVIS_TAG\""
  51. deploy:
  52. provider: releases
  53. token:
  54. secure: K9NKi7X1OPz898fxtVc1RfWrSI+4hTFFYOik932wTz1jC4dQJ64Khh1LV9frA1+JiDS3+R6TvmQtpzbkX3y4L75UrSnP1ADH5wfMYIVmydG3ZjTMo8SWQWHmRMh3ORAKTMMpjl4Q7EkRkLp6RncKe+FAFPP5mgv55mtIMaE4qUk=
  55. file: php-cs-fixer.phar
  56. skip_cleanup: true
  57. on:
  58. repo: FriendsOfPHP/PHP-CS-Fixer
  59. tags: true
  60. after_deploy:
  61. - ./dev-tools/trigger-website.sh ${TRAVIS_TOKEN} ${TRAVIS_TAG}