tests.yml 2.4 KB

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