tests.yml 2.6 KB

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