ci.yml 2.3 KB

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