tests.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. env:
  24. PHAN_ALLOW_XDEBUG: 0
  25. PHAN_DISABLE_XDEBUG_WARN: 1
  26. steps:
  27. - name: "Checkout"
  28. uses: actions/checkout@v3
  29. - name: "Install PHP"
  30. uses: shivammathur/setup-php@v2
  31. with:
  32. php-version: ${{ matrix.php-version }}
  33. coverage: none
  34. tools: pecl
  35. extensions: ast, gd, imagick, json, mbstring
  36. - name: "Update dependencies with composer"
  37. uses: ramsey/composer-install@v2
  38. - name: "Run phan"
  39. run: php vendor/bin/phan --target-php-version=${{ matrix.php-version }}
  40. tests:
  41. name: "Unit Tests"
  42. needs: static-code-analysis
  43. runs-on: ${{ matrix.os }}
  44. strategy:
  45. fail-fast: false
  46. matrix:
  47. os:
  48. - ubuntu-latest
  49. - windows-latest
  50. php-version:
  51. - "7.4"
  52. - "8.0"
  53. - "8.1"
  54. - "8.2"
  55. steps:
  56. - name: "Checkout"
  57. uses: actions/checkout@v3
  58. - name: "Install PHP with extensions"
  59. uses: shivammathur/setup-php@v2
  60. with:
  61. php-version: ${{ matrix.php-version }}
  62. coverage: pcov
  63. tools: pecl
  64. extensions: gd, imagick, json, mbstring
  65. - name: "Install dependencies with composer"
  66. uses: ramsey/composer-install@v2
  67. - name: "Run tests with phpunit"
  68. run: php vendor/bin/phpunit --configuration=phpunit.xml.dist
  69. - name: "Send code coverage report to Codecov.io"
  70. uses: codecov/codecov-action@v3
  71. - name: "Send code coverage report to Codacy"
  72. uses: codacy/codacy-coverage-reporter-action@v1
  73. with:
  74. project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
  75. coverage-reports: .build/coverage/clover.xml