tests.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. - main
  7. pull_request:
  8. branches:
  9. - main
  10. name: "Continuous Integration"
  11. jobs:
  12. static-code-analysis:
  13. name: "Static Code Analysis"
  14. runs-on: ubuntu-latest
  15. strategy:
  16. fail-fast: false
  17. matrix:
  18. php-version:
  19. - "7.4"
  20. - "8.0"
  21. - "8.1"
  22. env:
  23. PHAN_ALLOW_XDEBUG: 0
  24. PHAN_DISABLE_XDEBUG_WARN: 1
  25. steps:
  26. - name: "Checkout"
  27. uses: actions/checkout@v3
  28. - name: "Install PHP"
  29. uses: shivammathur/setup-php@v2
  30. with:
  31. php-version: ${{ matrix.php-version }}
  32. coverage: none
  33. tools: pecl
  34. extensions: ast, gd, imagick, json, mbstring
  35. - name: "Update dependencies with composer"
  36. run: composer update --no-interaction --no-ansi --no-progress --no-suggest
  37. - name: "Run phan"
  38. run: php vendor/bin/phan
  39. build-docs:
  40. name: "Build and publish Docs"
  41. runs-on: ubuntu-latest
  42. steps:
  43. - name: "Checkout sources"
  44. uses: actions/checkout@v3
  45. - name: "Install PHP"
  46. uses: shivammathur/setup-php@v2
  47. with:
  48. php-version: "8.0"
  49. coverage: none
  50. tools: phpDocumentor
  51. extensions: gd, imagick, json, mbstring
  52. - name: "Build Docs"
  53. run: phpdoc --config=phpdoc.xml
  54. - name: "Publish Docs to gh-pages"
  55. uses: JamesIves/github-pages-deploy-action@v4.2.5
  56. with:
  57. branch: gh-pages
  58. folder: docs
  59. clean: true
  60. tests:
  61. name: "Unit Tests"
  62. runs-on: ${{ matrix.os }}
  63. strategy:
  64. fail-fast: false
  65. matrix:
  66. os:
  67. - ubuntu-latest
  68. - windows-latest
  69. php-version:
  70. - "7.4"
  71. - "8.0"
  72. - "8.1"
  73. steps:
  74. - name: "Checkout"
  75. uses: actions/checkout@v3
  76. - name: "Install PHP with extensions"
  77. uses: shivammathur/setup-php@v2
  78. with:
  79. php-version: ${{ matrix.php-version }}
  80. coverage: pcov
  81. tools: pecl
  82. extensions: gd, imagick, json, mbstring
  83. - name: "Install dependencies with composer"
  84. run: composer update --no-ansi --no-interaction --no-progress --no-suggest
  85. - name: "Run tests with phpunit"
  86. run: php vendor/bin/phpunit --configuration=phpunit.xml
  87. - name: "Send code coverage report to Codecov.io"
  88. uses: codecov/codecov-action@v1
  89. with:
  90. token: ${{ secrets.CODECOV_TOKEN }}