tests.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.4"
  39. - "8.0"
  40. - "8.1"
  41. steps:
  42. # - name: "Configure git to avoid issues with line endings"
  43. # if: matrix.os == 'windows-latest'
  44. # run: git config --global core.autocrlf false
  45. - name: "Checkout"
  46. uses: actions/checkout@v2
  47. - name: "Install PHP with extensions"
  48. uses: shivammathur/setup-php@v2
  49. with:
  50. php-version: ${{ matrix.php-version }}
  51. coverage: pcov
  52. tools: pecl
  53. extensions: gd, imagick, json, mbstring
  54. - name: "Install dependencies with composer"
  55. run: composer update --no-ansi --no-interaction --no-progress --no-suggest
  56. - name: "Run tests with phpunit"
  57. run: php vendor/bin/phpunit --configuration=phpunit.xml
  58. - name: "Send code coverage report to Codecov.io"
  59. uses: codecov/codecov-action@v1
  60. with:
  61. token: ${{ secrets.CODECOV_TOKEN }}