continuous-integration.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. name: "Continuous Integration"
  2. on:
  3. pull_request:
  4. branches:
  5. - "*.x"
  6. push:
  7. branches:
  8. - "*.x"
  9. jobs:
  10. phpunit:
  11. name: "PHPUnit"
  12. runs-on: "ubuntu-20.04"
  13. env:
  14. SYMFONY_REQUIRE: ${{matrix.symfony-require}}
  15. SYMFONY_DEPRECATIONS_HELPER: ${{matrix.symfony-deprecations-helper}}
  16. strategy:
  17. fail-fast: false
  18. matrix:
  19. php-version:
  20. - "7.1"
  21. - "7.2"
  22. - "7.3"
  23. - "7.4"
  24. dependencies:
  25. - "highest"
  26. stability:
  27. - "stable"
  28. symfony-require:
  29. - ""
  30. symfony-deprecations-helper:
  31. - ""
  32. include:
  33. # Tests the lowest set of dependencies
  34. - dependencies: "lowest"
  35. stability: "stable"
  36. php-version: "7.1"
  37. symfony-deprecations-helper: "weak"
  38. # Test against latest Symfony 4.4 dev
  39. - symfony-require: "4.4.*"
  40. dependencies: "highest"
  41. php-version: "7.3"
  42. symfony-deprecations-helper: "weak"
  43. # Test against latest Symfony 5.2 dev
  44. - symfony-require: "5.2.*"
  45. dependencies: "highest"
  46. php-version: "7.3"
  47. symfony-deprecations-helper: "weak"
  48. - php-version: "8.0"
  49. dependencies: "highest"
  50. stability: "dev"
  51. symfony-deprecations-helper: "weak"
  52. steps:
  53. - name: "Checkout"
  54. uses: "actions/checkout@v2"
  55. with:
  56. fetch-depth: 2
  57. - name: "Install PHP with XDebug"
  58. uses: "shivammathur/setup-php@v2"
  59. if: "${{ matrix.php-version == '7.1' }}"
  60. with:
  61. php-version: "${{ matrix.php-version }}"
  62. coverage: "xdebug"
  63. ini-values: "zend.assertions=1"
  64. extensions: "pdo_sqlite"
  65. - name: "Install PHP with PCOV"
  66. uses: "shivammathur/setup-php@v2"
  67. if: "${{ matrix.php-version != '7.1' }}"
  68. with:
  69. php-version: "${{ matrix.php-version }}"
  70. coverage: "pcov"
  71. ini-values: "zend.assertions=1"
  72. extensions: "pdo_sqlite"
  73. - name: "Globally install symfony/flex"
  74. run: "composer global require --no-progress --no-scripts --no-plugins symfony/flex"
  75. - name: "Require symfony/messenger"
  76. run: "composer require --dev symfony/messenger --no-update"
  77. if: "${{ startsWith(matrix.symfony-require, '4.') }}"
  78. - name: "Enforce using stable dependencies"
  79. run: "composer config minimum-stability stable"
  80. if: "${{ matrix.stability == 'stable' }}"
  81. - name: "Install dependencies with Composer"
  82. uses: "ramsey/composer-install@v1"
  83. with:
  84. dependency-versions: "${{ matrix.dependencies }}"
  85. composer-options: "--prefer-dist"
  86. - name: "Run PHPUnit"
  87. run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
  88. - name: "Upload coverage file"
  89. uses: "actions/upload-artifact@v2"
  90. with:
  91. name: "phpunit-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}.coverage"
  92. path: "coverage.xml"
  93. upload_coverage:
  94. name: "Upload coverage to Codecov"
  95. runs-on: "ubuntu-20.04"
  96. needs:
  97. - "phpunit"
  98. steps:
  99. - name: "Checkout"
  100. uses: "actions/checkout@v2"
  101. with:
  102. fetch-depth: 2
  103. - name: "Download coverage files"
  104. uses: "actions/download-artifact@v2"
  105. with:
  106. path: "reports"
  107. - name: "Upload to Codecov"
  108. uses: "codecov/codecov-action@v1"
  109. with:
  110. directory: reports