tests.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. # ini-values:
  25. - name: "Update dependencies with composer"
  26. run: composer update --no-interaction --no-ansi --no-progress --no-suggest
  27. - name: "Run phan"
  28. run: php vendor/bin/phan
  29. tests:
  30. name: "Unit Tests"
  31. runs-on: ${{ matrix.os }}
  32. strategy:
  33. fail-fast: false
  34. matrix:
  35. os:
  36. - ubuntu-latest
  37. - windows-latest
  38. php-version:
  39. - "7.4"
  40. - "8.0"
  41. - "8.1"
  42. steps:
  43. # - name: "Configure git to avoid issues with line endings"
  44. # if: matrix.os == 'windows-latest'
  45. # run: git config --global core.autocrlf false
  46. - name: "Checkout"
  47. uses: actions/checkout@v2
  48. - name: "Install PHP with extensions"
  49. uses: shivammathur/setup-php@v2
  50. with:
  51. php-version: ${{ matrix.php-version }}
  52. coverage: pcov
  53. tools: pecl
  54. extensions: gd, imagick, json, mbstring
  55. # ini-values:
  56. - name: "Install dependencies with composer"
  57. run: composer update --no-ansi --no-interaction --no-progress --no-suggest
  58. - name: "Run tests with phpunit"
  59. run: php vendor/phpunit/phpunit/phpunit --configuration=phpunit.xml
  60. - name: "Send code coverage report to Codecov.io"
  61. uses: codecov/codecov-action@v1
  62. with:
  63. token: ${{ secrets.CODECOV_TOKEN }}