tests.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # https://help.github.com/en/categories/automating-your-workflow-with-github-actions
  2. # https://github.com/sebastianbergmann/phpunit/blob/master/.github/workflows/ci.yml
  3. on:
  4. push:
  5. branches:
  6. - v4.3.x
  7. pull_request:
  8. branches:
  9. - v4.3.x
  10. name: "Continuous Integration"
  11. jobs:
  12. static-code-analysis:
  13. name: "Static Code Analysis"
  14. runs-on: ubuntu-latest
  15. strategy:
  16. fail-fast: true
  17. matrix:
  18. php-version:
  19. - "7.4"
  20. - "8.0"
  21. - "8.1"
  22. - "8.2"
  23. - "8.3"
  24. - "8.4"
  25. env:
  26. PHAN_ALLOW_XDEBUG: 0
  27. PHAN_DISABLE_XDEBUG_WARN: 1
  28. steps:
  29. - name: "Checkout"
  30. uses: actions/checkout@v4
  31. - name: "Install PHP"
  32. uses: shivammathur/setup-php@v2
  33. with:
  34. php-version: ${{ matrix.php-version }}
  35. coverage: none
  36. tools: pecl
  37. extensions: ast, gd, imagick, json, mbstring
  38. - name: "Update dependencies with composer"
  39. uses: ramsey/composer-install@v3
  40. - name: "Run phan"
  41. run: php vendor/bin/phan --target-php-version=${{ matrix.php-version }}
  42. tests:
  43. name: "Unit Tests"
  44. needs: static-code-analysis
  45. runs-on: ${{ matrix.os }}
  46. strategy:
  47. fail-fast: false
  48. matrix:
  49. os:
  50. - ubuntu-latest
  51. - windows-latest
  52. php-version:
  53. - "7.4"
  54. - "8.0"
  55. - "8.1"
  56. - "8.2"
  57. - "8.3"
  58. - "8.4"
  59. steps:
  60. - name: "Checkout"
  61. uses: actions/checkout@v4
  62. - name: "Install PHP with extensions"
  63. uses: shivammathur/setup-php@v2
  64. with:
  65. php-version: ${{ matrix.php-version }}
  66. coverage: pcov
  67. tools: pecl
  68. extensions: gd, imagick, json, mbstring
  69. - name: "Install dependencies with composer"
  70. uses: ramsey/composer-install@v3
  71. - name: "Run tests with phpunit"
  72. run: php vendor/bin/phpunit --colors=always --configuration=phpunit.xml.dist
  73. - name: "Send code coverage report to Codecov.io"
  74. uses: codecov/codecov-action@v4
  75. with:
  76. token: ${{ secrets.CODECOV_TOKEN }}
  77. files: .build/coverage/clover.xml
  78. - name: "Send code coverage report to Codacy"
  79. uses: codacy/codacy-coverage-reporter-action@v1
  80. with:
  81. project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
  82. coverage-reports: .build/coverage/clover.xml