.travis.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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:
  24. - deps=high
  25. - PHPSTAN=1
  26. - php: 7.3
  27. env:
  28. - deps=high
  29. - php: nightly
  30. - php: 7.4snapshot
  31. fast_finish: true
  32. allow_failures:
  33. - php: nightly
  34. - php: 7.4snapshot
  35. before_install:
  36. # disable Xdebug if available
  37. - phpenv config-rm xdebug.ini || echo "xdebug not available"
  38. # disable default memory limit
  39. - export INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  40. - echo memory_limit = -1 >> $INI
  41. - composer validate
  42. install:
  43. # flags to pass to install
  44. - flags="--ansi --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress"
  45. # update deps to latest in case of high deps build
  46. - if [ "$deps" == "high" ]; then composer config platform.php 7.2.4; composer update $flags; fi
  47. # install dependencies using system provided composer binary
  48. - composer install $flags
  49. # install dependencies using composer from source
  50. - bin/composer install $flags
  51. before_script:
  52. # make sure git tests do not complain about user/email not being set
  53. - git config --global user.name travis-ci
  54. - git config --global user.email travis@example.com
  55. script:
  56. # run test suite directories in parallel using GNU parallel
  57. - 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);'
  58. # Run PHPStan
  59. - if [[ $PHPSTAN == "1" ]]; then
  60. bin/composer require --dev phpstan/phpstan:^0.12 &&
  61. vendor/bin/phpstan analyse --configuration=phpstan/config.neon;
  62. fi
  63. before_deploy:
  64. - php -d phar.readonly=0 bin/compile
  65. deploy:
  66. provider: releases
  67. api_key: $GITHUB_TOKEN
  68. file: composer.phar
  69. skip_cleanup: true
  70. on:
  71. tags: true
  72. repo: composer/composer
  73. php: '7.2'