ci.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # https://docs.github.com/en/actions
  2. name: "CI"
  3. on:
  4. pull_request: ~
  5. push:
  6. branches:
  7. - "master"
  8. env:
  9. COMPOSER_ROOT_VERSION: 1.99
  10. jobs:
  11. coding-standards:
  12. name: "Coding Standards"
  13. runs-on: "ubuntu-latest"
  14. steps:
  15. - name: "Checkout"
  16. uses: "actions/checkout@v2.3.4"
  17. - name: "Install PHP"
  18. uses: "shivammathur/setup-php@2.9.0"
  19. with:
  20. coverage: "none"
  21. extensions: "mbstring"
  22. php-version: "7.4"
  23. tools: "composer-normalize"
  24. - name: "Validate composer.json"
  25. run: "composer validate --strict"
  26. - name: "Normalize composer.json"
  27. run: "composer-normalize --dry-run"
  28. - name: "PHP-CS-Fixer"
  29. uses: "docker://oskarstark/php-cs-fixer-ga:2.18.0"
  30. with:
  31. args: "--dry-run --diff-format udiff"
  32. static-code-analysis:
  33. name: "Static Code Analysis"
  34. runs-on: "ubuntu-latest"
  35. steps:
  36. - name: "Checkout"
  37. uses: "actions/checkout@v2.3.4"
  38. - name: "Install PHP"
  39. uses: "shivammathur/setup-php@2.9.0"
  40. with:
  41. coverage: "none"
  42. extensions: "mbstring"
  43. php-version: "7.4"
  44. - name: "Install dependencies with composer"
  45. run: "composer update --no-interaction --no-progress && composer i --working-dir=ci"
  46. - name: "Run vimeo/psalm"
  47. run: "ci/vendor/bin/psalm --threads=4"
  48. tests:
  49. name: "Tests"
  50. runs-on: "ubuntu-latest"
  51. strategy:
  52. matrix:
  53. php-version:
  54. - "7.2"
  55. - "7.3"
  56. - "7.4"
  57. - "8.0"
  58. steps:
  59. - name: "Checkout"
  60. uses: "actions/checkout@v2.3.4"
  61. - name: "Install PHP"
  62. uses: "shivammathur/setup-php@2.9.0"
  63. with:
  64. coverage: "none"
  65. extensions: "mbstring"
  66. php-version: "${{ matrix.php-version }}"
  67. - name: "Install dependencies with composer"
  68. run: "composer update --no-interaction --no-progress"
  69. - name: "Run unit tests"
  70. run: "vendor/bin/phpunit"
  71. windows-tests:
  72. name: "Windows tests"
  73. runs-on: "windows-latest"
  74. strategy:
  75. matrix:
  76. php-version:
  77. - "7.4"
  78. steps:
  79. - name: "Checkout"
  80. uses: "actions/checkout@v2.3.4"
  81. - name: "Install PHP"
  82. uses: "shivammathur/setup-php@2.9.0"
  83. with:
  84. coverage: "none"
  85. extensions: "mbstring"
  86. php-version: "${{ matrix.php-version }}"
  87. - name: "Install dependencies with composer"
  88. run: "composer update --no-interaction --no-progress"
  89. - name: "Run unit tests"
  90. run: "vendor/bin/phpunit tests/AssertTest.php"