tests.yml 2.0 KB

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