ci.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # https://help.github.com/en/categories/automating-your-workflow-with-github-actions
  2. on:
  3. - pull_request
  4. - push
  5. name: CI
  6. env:
  7. COMPOSER_ROOT_VERSION: "9.2-dev"
  8. jobs:
  9. coding-guidelines:
  10. name: Coding Guidelines
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Checkout
  14. uses: actions/checkout@v3
  15. - name: Install PHP
  16. uses: shivammathur/setup-php@v2
  17. with:
  18. php-version: 8.2
  19. extensions: :apcu, :imagick
  20. coverage: none
  21. tools: none
  22. - name: Run PHP-CS-Fixer
  23. run: ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose
  24. type-checker:
  25. name: Type Checker
  26. runs-on: ubuntu-latest
  27. steps:
  28. - name: Checkout
  29. uses: actions/checkout@v3
  30. - name: Install PHP
  31. uses: shivammathur/setup-php@v2
  32. with:
  33. php-version: 8.2
  34. extensions: :apcu, :imagick
  35. coverage: none
  36. tools: none
  37. - name: Update dependencies with composer
  38. run: ./tools/composer update --no-interaction --no-ansi --no-progress
  39. - name: Run vimeo/psalm
  40. run: ./tools/psalm --config=.psalm/config.xml --no-progress --shepherd --show-info=false --stats
  41. tests:
  42. name: Tests
  43. runs-on: ${{ matrix.os }}
  44. env:
  45. PHP_EXTENSIONS: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter, :apcu, :imagick
  46. PHP_INI_VALUES: memory_limit=-1, assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
  47. strategy:
  48. fail-fast: false
  49. matrix:
  50. os:
  51. - ubuntu-latest
  52. - windows-latest
  53. php-version:
  54. - "7.3"
  55. - "7.4"
  56. - "8.0"
  57. - "8.1"
  58. - "8.2"
  59. - "8.3"
  60. - "8.4"
  61. coverage-driver:
  62. - "pcov"
  63. - "xdebug"
  64. - "xdebug3"
  65. exclude:
  66. - php-version: "8.0"
  67. coverage-driver: "xdebug"
  68. - php-version: "8.1"
  69. coverage-driver: "xdebug"
  70. - php-version: "8.2"
  71. coverage-driver: "xdebug"
  72. - php-version: "8.3"
  73. coverage-driver: "xdebug"
  74. steps:
  75. - name: Configure Git to avoid issues with line endings
  76. if: matrix.os == 'windows-latest'
  77. run: git config --global core.autocrlf false
  78. - name: Checkout
  79. uses: actions/checkout@v3
  80. - name: Install PHP with extensions
  81. uses: shivammathur/setup-php@v2
  82. with:
  83. php-version: ${{ matrix.php-version }}
  84. coverage: ${{ matrix.coverage-driver }}
  85. extensions: ${{ env.PHP_EXTENSIONS }}
  86. ini-values: ${{ env.PHP_INI_VALUES }}
  87. tools: none
  88. - name: Install dependencies with Composer
  89. run: php ./tools/composer update --no-ansi --no-interaction --no-progress
  90. - name: Run tests with PHPUnit
  91. run: vendor/bin/phpunit --coverage-clover=coverage.xml
  92. - name: Send code coverage report to Codecov.io
  93. uses: codecov/codecov-action@v3
  94. with:
  95. token: ${{ secrets.CODECOV_TOKEN }}