tests.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. - pull_request
  5. - push
  6. name: "Continuous Integration"
  7. jobs:
  8. static-code-analysis:
  9. name: "Static Code Analysis"
  10. runs-on: ubuntu-latest
  11. env:
  12. PHAN_ALLOW_XDEBUG: 0
  13. PHAN_DISABLE_XDEBUG_WARN: 1
  14. steps:
  15. - name: "Checkout"
  16. uses: actions/checkout@v3
  17. - name: "Install PHP"
  18. uses: shivammathur/setup-php@v2
  19. with:
  20. php-version: "7.4"
  21. coverage: none
  22. tools: pecl
  23. extensions: ast, gd, imagick, json, mbstring
  24. - name: "Update dependencies with composer"
  25. run: composer update --no-interaction --no-ansi --no-progress --no-suggest
  26. - name: "Run phan"
  27. run: php vendor/bin/phan
  28. tests:
  29. name: "Unit Tests"
  30. runs-on: ${{ matrix.os }}
  31. strategy:
  32. fail-fast: false
  33. matrix:
  34. os:
  35. - ubuntu-latest
  36. # - windows-latest
  37. php-version:
  38. - "7.2"
  39. - "7.3"
  40. - "7.4"
  41. - "8.0"
  42. - "8.1"
  43. steps:
  44. - name: "Checkout"
  45. uses: actions/checkout@v3
  46. - name: "Install PHP with extensions"
  47. uses: shivammathur/setup-php@v2
  48. with:
  49. php-version: ${{ matrix.php-version }}
  50. coverage: pcov
  51. tools: pecl
  52. extensions: gd, imagick, json, mbstring
  53. - name: "Install dependencies with composer"
  54. run: composer update --no-ansi --no-interaction --no-progress --no-suggest
  55. - name: "Run tests with phpunit"
  56. run: php vendor/phpunit/phpunit/phpunit --configuration=phpunit.xml
  57. - name: "Send code coverage report to Codecov.io"
  58. uses: codecov/codecov-action@v3