tests.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. name: tests
  2. on: [push, pull_request]
  3. jobs:
  4. tests:
  5. name: Test PHP ${{ matrix.php }}
  6. runs-on: ubuntu-latest
  7. continue-on-error: ${{ matrix.experimental }}
  8. strategy:
  9. matrix:
  10. php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
  11. experimental: [false]
  12. include:
  13. - php: 8.1
  14. analysis: true
  15. steps:
  16. - name: Checkout
  17. uses: actions/checkout@v2
  18. - name: Set up PHP ${{ matrix.php }}
  19. uses: shivammathur/setup-php@v2
  20. with:
  21. php-version: ${{ matrix.php }}
  22. coverage: xdebug
  23. - name: Install dependencies with Composer
  24. run: composer install --no-progress --prefer-dist --optimize-autoloader
  25. - name: Coding standards
  26. if: matrix.analysis
  27. run: vendor/bin/phpcs
  28. - name: Tests
  29. run: vendor/bin/phpunit --coverage-clover clover.xml
  30. - name: Upload coverage results to Coveralls
  31. if: matrix.analysis
  32. env:
  33. COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  34. run: |
  35. composer require php-coveralls/php-coveralls -n -W
  36. vendor/bin/php-coveralls --coverage_clover=clover.xml -v