You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4 KiB

3 years ago
  1. name: Tests
  2. on:
  3. push:
  4. pull_request:
  5. jobs:
  6. tests:
  7. name: PHP ${{ matrix.php }}
  8. runs-on: ubuntu-20.04
  9. strategy:
  10. matrix:
  11. php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
  12. steps:
  13. - name: Checkout Code
  14. uses: actions/checkout@v2
  15. - name: Setup PHP
  16. uses: shivammathur/setup-php@v2
  17. with:
  18. php-version: ${{ matrix.php }}
  19. tools: composer:v2
  20. coverage: none
  21. env:
  22. update: true
  23. - name: Setup Problem Matchers
  24. run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
  25. - name: Fix PHPUnit Version PHP < 7.4
  26. uses: nick-invision/retry@v1
  27. with:
  28. timeout_minutes: 5
  29. max_attempts: 5
  30. command: composer require "phpunit/phpunit:^6.5.14 || ^7.5.20 || ^8.5.8" --dev --no-update --no-interaction
  31. if: "matrix.php < 7.4"
  32. - name: Fix PHPUnit Version PHP >= 7.4
  33. uses: nick-invision/retry@v1
  34. with:
  35. timeout_minutes: 5
  36. max_attempts: 5
  37. command: composer require "phpunit/phpunit:^9.3.3" --dev --no-update --no-interaction
  38. if: "matrix.php >= 7.4"
  39. - name: Install PHP Dependencies
  40. uses: nick-invision/retry@v1
  41. with:
  42. timeout_minutes: 5
  43. max_attempts: 5
  44. command: composer update --no-interaction --no-progress
  45. - name: Execute PHPUnit
  46. run: vendor/bin/phpunit