main.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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@v2"
  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. steps:
  42. - name: "Checkout"
  43. uses: "actions/checkout@v2"
  44. - name: "Install PHP"
  45. uses: "shivammathur/setup-php@v2"
  46. with:
  47. coverage: "none"
  48. php-version: "${{ matrix.php-version }}"
  49. tools: composer:v2
  50. - name: "Install dependencies"
  51. run: "composer update --no-progress --prefer-dist"
  52. - name: "PHPUnit"
  53. run: "php vendor/bin/phpunit"
  54. test_old_73_80:
  55. runs-on: "ubuntu-latest"
  56. name: "PHP 7.3 Code on PHP 8.0 Integration Tests"
  57. steps:
  58. - name: "Checkout"
  59. uses: "actions/checkout@v2"
  60. - name: "Install PHP"
  61. uses: "shivammathur/setup-php@v2"
  62. with:
  63. coverage: "none"
  64. php-version: "8.0"
  65. tools: composer:v2
  66. - name: "Install PHP 8 dependencies"
  67. run: "composer update --no-progress --prefer-dist"
  68. - name: "Tests"
  69. run: "test_old/run-php-src.sh 7.3.21"
  70. test_old_80_70:
  71. runs-on: "ubuntu-latest"
  72. name: "PHP 8.0 Code on PHP 7.0 Integration Tests"
  73. steps:
  74. - name: "Checkout"
  75. uses: "actions/checkout@v2"
  76. - name: "Install PHP"
  77. uses: "shivammathur/setup-php@v2"
  78. with:
  79. coverage: "none"
  80. php-version: "7.0"
  81. tools: composer:v2
  82. - name: "Install PHP 8 dependencies"
  83. run: "composer update --no-progress --prefer-dist"
  84. - name: "Tests"
  85. run: "test_old/run-php-src.sh 8.0.0"