.travis.yml 2.2 KB

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