tests.yaml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. name: Tests
  2. on:
  3. pull_request: null
  4. push:
  5. branches:
  6. - 1.x
  7. jobs:
  8. tests:
  9. runs-on: ubuntu-latest
  10. strategy:
  11. matrix:
  12. php:
  13. - '7.0'
  14. - '7.1'
  15. - '7.2'
  16. - '7.3'
  17. - '7.4'
  18. - '8.0'
  19. name: PHP ${{ matrix.php }} tests
  20. steps:
  21. # checkout git
  22. - uses: actions/checkout@v2
  23. # cache
  24. - uses: actions/cache@v2
  25. with:
  26. path: ~/.composer/cache/files
  27. key: ${{ matrix.php }}
  28. # setup PHP
  29. - uses: shivammathur/setup-php@v2
  30. with:
  31. php-version: ${{ matrix.php }}
  32. coverage: xdebug
  33. - run: composer install --no-progress --ansi
  34. if: matrix.php != '8.0'
  35. - run: composer install --no-progress --ansi --ignore-platform-reqs
  36. if: matrix.php == '8.0'
  37. - run: vendor/bin/phpunit --coverage-clover=coverage.xml
  38. if: matrix.php != '8.0'
  39. - run: vendor/bin/phpunit
  40. if: matrix.php == '8.0'
  41. - uses: codecov/codecov-action@v1
  42. if: matrix.php != '8.0'
  43. with:
  44. file: './coverage.xml'
  45. fail_ci_if_error: true