tests.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. 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. build-docs:
  33. name: "Build and publish Docs"
  34. runs-on: ubuntu-latest
  35. steps:
  36. - name: "Checkout sources"
  37. uses: actions/checkout@v2
  38. - name: "Install PHP"
  39. uses: shivammathur/setup-php@v2
  40. with:
  41. php-version: "7.4"
  42. coverage: none
  43. tools: phpDocumentor
  44. extensions: gd, imagick, json, mbstring
  45. - name: "Build Docs"
  46. run: phpdoc --config=phpdoc.xml
  47. - name: "Publish Docs to gh-pages"
  48. uses: JamesIves/github-pages-deploy-action@4.1.6
  49. with:
  50. BRANCH: gh-pages
  51. FOLDER: docs
  52. CLEAN: true
  53. tests:
  54. name: "Unit Tests"
  55. runs-on: ${{ matrix.os }}
  56. strategy:
  57. fail-fast: false
  58. matrix:
  59. os:
  60. - ubuntu-latest
  61. - windows-latest
  62. php-version:
  63. - "7.4"
  64. - "8.0"
  65. - "8.1"
  66. steps:
  67. - name: "Checkout"
  68. uses: actions/checkout@v2
  69. - name: "Install PHP with extensions"
  70. uses: shivammathur/setup-php@v2
  71. with:
  72. php-version: ${{ matrix.php-version }}
  73. coverage: pcov
  74. tools: pecl
  75. extensions: gd, imagick, json, mbstring
  76. - name: "Install dependencies with composer"
  77. run: composer update --no-ansi --no-interaction --no-progress --no-suggest
  78. - name: "Run tests with phpunit"
  79. run: php vendor/bin/phpunit --configuration=phpunit.xml
  80. - name: "Send code coverage report to Codecov.io"
  81. uses: codecov/codecov-action@v1
  82. with:
  83. token: ${{ secrets.CODECOV_TOKEN }}