.travis.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. language: php
  2. dist: trusty
  3. git:
  4. depth: 5
  5. cache:
  6. directories:
  7. - $HOME/.composer/cache
  8. addons:
  9. apt:
  10. packages:
  11. - parallel
  12. matrix:
  13. include:
  14. - php: 5.3
  15. dist: precise
  16. - php: 5.4
  17. - php: 5.5
  18. - php: 5.6
  19. - php: 7.0
  20. - php: 7.1
  21. - php: 7.2
  22. - php: 7.3
  23. env: PHPSTAN=1
  24. - php: 7.3
  25. env:
  26. - deps=high
  27. - php: nightly
  28. - php: 7.4snapshot
  29. fast_finish: true
  30. allow_failures:
  31. - php: nightly
  32. - php: 7.4snapshot
  33. before_install:
  34. # disable Xdebug if available
  35. - phpenv config-rm xdebug.ini || echo "xdebug not available"
  36. # disable default memory limit
  37. - export INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  38. - echo memory_limit = -1 >> $INI
  39. - composer validate
  40. install:
  41. # flags to pass to install
  42. - flags="--ansi --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress"
  43. # update deps to latest in case of high deps build
  44. - if [ "$deps" == "high" ]; then composer config platform.php 7.2.4; composer update $flags; fi
  45. # install dependencies using system provided composer binary
  46. - composer install $flags
  47. # install dependencies using composer from source
  48. - bin/composer install $flags
  49. before_script:
  50. # make sure git tests do not complain about user/email not being set
  51. - git config --global user.name travis-ci
  52. - git config --global user.email travis@example.com
  53. script:
  54. # run test suite directories in parallel using GNU parallel
  55. - ls -d tests/Composer/Test/* | grep -v TestCase.php | parallel --gnu --keep-order 'echo "Running {} tests"; ./vendor/bin/phpunit -c tests/complete.phpunit.xml --colors=always {} || (echo -e "\e[41mFAILED\e[0m {}" && exit 1);'
  56. # Run PHPStan
  57. - if [[ $PHPSTAN == "1" ]]; then
  58. bin/composer require --dev phpstan/phpstan-shim:^0.11 --ignore-platform-reqs &&
  59. vendor/bin/phpstan.phar analyse --configuration=phpstan/config.neon;
  60. fi
  61. before_deploy:
  62. - php -d phar.readonly=0 bin/compile
  63. deploy:
  64. provider: releases
  65. api_key: $GITHUB_TOKEN
  66. file: composer.phar
  67. skip_cleanup: true
  68. on:
  69. tags: true
  70. repo: composer/composer
  71. php: '7.2'