.travis.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. language: php
  2. dist: bionic
  3. git:
  4. depth: 5
  5. cache:
  6. directories:
  7. - $HOME/.composer/cache
  8. matrix:
  9. include:
  10. - php: 5.3
  11. dist: precise
  12. env:
  13. - PHP_LINT=1
  14. - php: 5.4
  15. dist: trusty
  16. - php: 5.5
  17. dist: trusty
  18. - php: 5.6
  19. dist: xenial
  20. - php: 7.0
  21. dist: xenial
  22. - php: 7.1
  23. dist: xenial
  24. - php: 7.2
  25. dist: xenial
  26. - php: 7.3
  27. dist: xenial
  28. # Regular 7.4 build with locked deps
  29. - php: 7.4
  30. env:
  31. - SYMFONY_PHPUNIT_VERSION=7.5
  32. # High deps check
  33. - php: 7.4
  34. env:
  35. - deps=high
  36. - SYMFONY_PHPUNIT_VERSION=7.5
  37. # PHPStan checks
  38. - php: 7.4
  39. env:
  40. - deps=high
  41. - PHPSTAN=1
  42. - SYMFONY_PHPUNIT_VERSION=7.5
  43. - php: nightly
  44. fast_finish: true
  45. allow_failures:
  46. - php: nightly
  47. before_install:
  48. # disable Xdebug if available
  49. - phpenv config-rm xdebug.ini || echo "xdebug not available"
  50. # disable default memory limit
  51. - export INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  52. - echo memory_limit = -1 >> $INI
  53. - composer validate
  54. install:
  55. # flags to pass to install
  56. - flags="--ansi --prefer-dist --no-interaction --optimize-autoloader --no-progress"
  57. # update deps to latest in case of high deps build
  58. - if [ "$deps" == "high" ]; then composer config platform.php 7.4.0; composer update $flags; fi
  59. # install dependencies using system provided composer binary
  60. - composer install $flags
  61. # install dependencies using composer from source
  62. - bin/composer install $flags
  63. before_script:
  64. # make sure git tests do not complain about user/email not being set
  65. - git config --global user.name travis-ci
  66. - git config --global user.email travis@example.com
  67. script:
  68. - if [[ "$PHP_LINT" == "1" ]]; then find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f; fi
  69. - if [[ $PHPSTAN == "1" ]]; then
  70. bin/composer require --dev phpstan/phpstan:^0.12 phpunit/phpunit:^7.5 --no-update &&
  71. bin/composer update phpstan/* phpunit/* sebastian/* --with-all-dependencies &&
  72. vendor/bin/phpstan analyse --configuration=phpstan/config.neon;
  73. else
  74. vendor/bin/simple-phpunit;
  75. fi
  76. before_deploy:
  77. - php -d phar.readonly=0 bin/compile
  78. deploy:
  79. provider: releases
  80. api_key: $GITHUB_TOKEN
  81. file: composer.phar
  82. skip_cleanup: true
  83. on:
  84. tags: true
  85. repo: composer/composer
  86. php: '7.3'