tests.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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:3
  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.5
  45. with:
  46. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  47. BRANCH: gh-pages
  48. FOLDER: docs
  49. CLEAN: true
  50. tests:
  51. name: "Unit Tests"
  52. runs-on: ${{ matrix.os }}
  53. strategy:
  54. fail-fast: false
  55. matrix:
  56. os:
  57. - ubuntu-latest
  58. - windows-latest
  59. php-version:
  60. - "7.4"
  61. - "8.0"
  62. - "8.1"
  63. steps:
  64. - name: "Checkout"
  65. uses: actions/checkout@v2
  66. - name: "Install PHP with extensions"
  67. uses: shivammathur/setup-php@v2
  68. with:
  69. php-version: ${{ matrix.php-version }}
  70. coverage: pcov
  71. tools: pecl
  72. extensions: gd, imagick, json, mbstring
  73. - name: "Install dependencies with composer"
  74. run: composer update --no-ansi --no-interaction --no-progress --no-suggest
  75. - name: "Run tests with phpunit"
  76. run: php vendor/bin/phpunit --configuration=phpunit.xml
  77. - name: "Send code coverage report to Codecov.io"
  78. uses: codecov/codecov-action@v1
  79. with:
  80. token: ${{ secrets.CODECOV_TOKEN }}