tests.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: Tests
  2. on: [push, pull_request]
  3. jobs:
  4. tests:
  5. runs-on: ${{ matrix.os }}
  6. strategy:
  7. matrix:
  8. os: [ubuntu-latest, windows-latest]
  9. php: ['8.0', '8.1', '8.2', '8.3']
  10. fail-fast: false
  11. name: PHP ${{ matrix.php }} tests on ${{ matrix.os }}
  12. steps:
  13. - uses: actions/checkout@v3
  14. - uses: shivammathur/setup-php@v2
  15. with:
  16. php-version: ${{ matrix.php }}
  17. extensions: iconv, json, mbstring, xml, gd, intl, tokenizer
  18. coverage: none
  19. - run: composer install --no-progress --prefer-dist
  20. - run: vendor/bin/tester tests -s -C
  21. - if: failure()
  22. uses: actions/upload-artifact@v3
  23. with:
  24. name: output
  25. path: tests/**/output
  26. code_coverage:
  27. name: Code Coverage
  28. runs-on: ubuntu-latest
  29. steps:
  30. - uses: actions/checkout@v3
  31. - uses: shivammathur/setup-php@v2
  32. with:
  33. php-version: 8.0
  34. extensions: iconv, json, mbstring, xml, gd, intl, tokenizer
  35. coverage: none
  36. - run: composer install --no-progress --prefer-dist
  37. - run: vendor/bin/tester -p phpdbg tests -s -C --coverage ./coverage.xml --coverage-src ./src
  38. - run: wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar
  39. - env:
  40. COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  41. run: php php-coveralls.phar --verbose --config tests/.coveralls.yml