tests.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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@v2
  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. steps:
  43. - name: "Checkout"
  44. uses: actions/checkout@v2
  45. - name: "Install PHP with extensions"
  46. uses: shivammathur/setup-php@v2
  47. with:
  48. php-version: ${{ matrix.php-version }}
  49. coverage: pcov
  50. tools: pecl
  51. extensions: gd, imagick, json, mbstring
  52. - name: "Install dependencies with composer"
  53. run: composer update --no-ansi --no-interaction --no-progress --no-suggest
  54. - name: "Run tests with phpunit"
  55. run: php vendor/phpunit/phpunit/phpunit --configuration=phpunit.xml
  56. - name: "Send code coverage report to Codecov.io"
  57. uses: codecov/codecov-action@v1
  58. with:
  59. token: ${{ secrets.CODECOV_TOKEN }}