continuous-integration.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. name: "Continuous Integration"
  2. on:
  3. push:
  4. paths-ignore:
  5. - 'doc/**'
  6. pull_request:
  7. paths-ignore:
  8. - 'doc/**'
  9. env:
  10. COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist"
  11. SYMFONY_PHPUNIT_VERSION: ""
  12. jobs:
  13. tests:
  14. name: "CI"
  15. runs-on: ${{ matrix.os }}
  16. continue-on-error: ${{ matrix.experimental }}
  17. strategy:
  18. matrix:
  19. php-version:
  20. - "5.3"
  21. - "5.4"
  22. - "5.5"
  23. - "5.6"
  24. - "7.0"
  25. - "7.1"
  26. - "7.2"
  27. - "7.3"
  28. - "7.4"
  29. dependencies: [locked]
  30. os: [ubuntu-latest]
  31. experimental: [false]
  32. include:
  33. - php-version: 5.3
  34. dependencies: highest
  35. os: ubuntu-latest
  36. experimental: false
  37. - php-version: 5.3
  38. dependencies: lowest
  39. os: ubuntu-latest
  40. experimental: false
  41. - php-version: 7.4
  42. dependencies: highest
  43. os: ubuntu-latest
  44. experimental: false
  45. - php-version: 7.4
  46. os: windows-latest
  47. dependencies: locked
  48. experimental: false
  49. - php-version: 7.4
  50. os: macos-latest
  51. dependencies: locked
  52. experimental: false
  53. - php-version: 8.0
  54. dependencies: lowest
  55. os: ubuntu-latest
  56. experimental: true
  57. - php-version: 8.0
  58. dependencies: highest-ignore
  59. os: ubuntu-latest
  60. experimental: true
  61. steps:
  62. - name: "Checkout"
  63. uses: "actions/checkout@v2"
  64. - name: "Install PHP"
  65. uses: "shivammathur/setup-php@v2"
  66. with:
  67. coverage: "none"
  68. extensions: "intl"
  69. ini-values: "memory_limit=-1, phar.readonly=0"
  70. php-version: "${{ matrix.php-version }}"
  71. - name: "Determine composer cache directory"
  72. id: "determine-composer-cache-directory"
  73. run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
  74. - name: "Cache dependencies installed with composer"
  75. uses: "actions/cache@v1"
  76. with:
  77. path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
  78. key: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}-${{ hashFiles('**/composer.lock') }}"
  79. restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}"
  80. - name: "Install highest dependencies from composer.json using composer binary provided by system"
  81. if: "matrix.dependencies == 'highest'"
  82. run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}"
  83. - name: "Install highest dependencies from composer.json using composer binary provided by system, ignoring platform requirements"
  84. if: "matrix.dependencies == 'highest-ignore'"
  85. run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }} --ignore-platform-reqs"
  86. - name: "Install lowest dependencies from composer.json using composer binary provided by system"
  87. if: "matrix.dependencies == 'lowest'"
  88. run: "composer update ${{ env.COMPOSER_FLAGS }} --prefer-lowest"
  89. - name: "Install dependencies from composer.lock using composer binary provided by system"
  90. if: "matrix.dependencies == 'locked'"
  91. run: "composer install ${{ env.COMPOSER_FLAGS }}"
  92. - name: "Run install again using composer binary from source"
  93. if: "matrix.dependencies != 'highest-ignore'"
  94. run: "bin/composer install ${{ env.COMPOSER_FLAGS }}"
  95. - name: "Validate composer.json"
  96. run: "bin/composer validate"
  97. - name: "Prepare git environment"
  98. run: "git config --global user.name composer && git config --global user.email composer@example.com"
  99. - name: "Set SYMFONY_PHPUNIT_VERSION environment variable"
  100. if: "matrix.php-version == '7.4'"
  101. run: "echo \"::set-env name=SYMFONY_PHPUNIT_VERSION::7.5\""
  102. - name: "Run tests"
  103. if: "matrix.php-version != '8.0' && matrix.php-version != '7.3'"
  104. run: "vendor/bin/simple-phpunit"
  105. - name: "Run Complete test suite"
  106. if: "matrix.php-version == '7.3'"
  107. run: "vendor/bin/simple-phpunit --configuration tests/complete.phpunit.xml"
  108. - name: "Run tests for PHP 8"
  109. if: "matrix.php-version == '8.0'"
  110. run: |
  111. bin/composer remove --dev symfony/phpunit-bridge --ignore-platform-reqs
  112. bin/composer require phpunit/phpunit:^7.5 --ignore-platform-reqs --with-dependencies
  113. vendor/bin/phpunit