main.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # https://help.github.com/en/categories/automating-your-workflow-with-github-actions
  2. name: Main
  3. on:
  4. push:
  5. pull_request:
  6. jobs:
  7. tests_70:
  8. runs-on: "ubuntu-latest"
  9. name: "PHP 7.0 Unit Tests"
  10. steps:
  11. - name: "Checkout"
  12. uses: "actions/checkout@v3"
  13. - name: "Install PHP"
  14. uses: "shivammathur/setup-php@v2"
  15. with:
  16. coverage: "xdebug"
  17. php-version: "7.0"
  18. tools: composer:v2
  19. - name: "Install dependencies"
  20. run: |
  21. composer require php-coveralls/php-coveralls:^2.2 --dev --no-update
  22. composer update --no-progress --prefer-dist
  23. - name: "Tests"
  24. run: "php vendor/bin/phpunit --coverage-clover build/logs/clover.xml"
  25. - name: Coveralls
  26. env:
  27. COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  28. run: "php vendor/bin/php-coveralls"
  29. if: ${{ success() }}
  30. tests:
  31. runs-on: "ubuntu-latest"
  32. name: "PHP ${{ matrix.php-version }} Unit Tests"
  33. strategy:
  34. matrix:
  35. php-version:
  36. - "7.1"
  37. - "7.2"
  38. - "7.3"
  39. - "7.4"
  40. - "8.0"
  41. - "8.1"
  42. - "8.2"
  43. - "8.3"
  44. steps:
  45. - name: "Checkout"
  46. uses: "actions/checkout@v3"
  47. - name: "Install PHP"
  48. uses: "shivammathur/setup-php@v2"
  49. with:
  50. coverage: "none"
  51. php-version: "${{ matrix.php-version }}"
  52. tools: composer:v2
  53. - name: "Install dependencies"
  54. run: "composer update --no-progress --prefer-dist ${{ matrix.flags }}"
  55. - name: "PHPUnit"
  56. run: "php vendor/bin/phpunit"
  57. test_old_73_80:
  58. runs-on: "ubuntu-latest"
  59. name: "PHP 7.3 Code on PHP 8.0 Integration Tests"
  60. steps:
  61. - name: "Checkout"
  62. uses: "actions/checkout@v3"
  63. - name: "Install PHP"
  64. uses: "shivammathur/setup-php@v2"
  65. with:
  66. coverage: "none"
  67. php-version: "8.0"
  68. tools: composer:v2
  69. - name: "Install PHP 8 dependencies"
  70. run: "composer update --no-progress --prefer-dist"
  71. - name: "Tests"
  72. run: "test_old/run-php-src.sh 7.3.21"
  73. test_old_80_70:
  74. runs-on: "ubuntu-latest"
  75. name: "PHP 8.1 Code on PHP 7.0 Integration Tests"
  76. steps:
  77. - name: "Checkout"
  78. uses: "actions/checkout@v3"
  79. - name: "Install PHP"
  80. uses: "shivammathur/setup-php@v2"
  81. with:
  82. coverage: "none"
  83. php-version: "7.0"
  84. tools: composer:v2
  85. - name: "Install PHP 8 dependencies"
  86. run: "composer update --no-progress --prefer-dist"
  87. - name: "Tests"
  88. run: "test_old/run-php-src.sh 8.1.6"