main.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: CI
  2. on: [push, pull_request]
  3. concurrency:
  4. group: ${{ github.workflow }}-${{ github.ref }}
  5. cancel-in-progress: true
  6. jobs:
  7. phpunit:
  8. name: PHPUnit (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})
  9. runs-on: ${{ matrix.operating-system }}
  10. strategy:
  11. fail-fast: false
  12. matrix:
  13. operating-system: [ubuntu-latest, windows-latest]
  14. php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
  15. steps:
  16. - name: Setup PHP
  17. uses: shivammathur/setup-php@v2
  18. with:
  19. php-version: ${{ matrix.php-version }}
  20. extensions: curl, mbstring, openssl, xml
  21. coverage: none
  22. - name: Checkout
  23. uses: actions/checkout@v4
  24. - name: Install dependencies
  25. run: composer install --ansi --prefer-dist --no-interaction --no-progress
  26. - name: PHPUnit Migrate Configuration
  27. if: ${{ matrix.php-version >= '8.0' }}
  28. run: vendor/bin/phpunit --migrate-configuration
  29. - name: Run Unit Tests (PHP 5.6 - 8.0)
  30. if: ${{ matrix.php-version < '8.1' }}
  31. run: vendor/bin/phpunit --testsuite UnitTest
  32. env:
  33. PHP_ERROR_REPORTING: E_ALL
  34. - name: Run Unit Tests (PHP 8.1+)
  35. if: ${{ matrix.php-version >= '8.1' }}
  36. run: vendor/bin/phpunit --testsuite UnitTest --fail-on-deprecation --display-deprecations
  37. env:
  38. PHP_ERROR_REPORTING: E_ALL