test.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. name: Test
  2. on: [push, pull_request]
  3. jobs:
  4. test:
  5. strategy:
  6. matrix:
  7. os: [ubuntu-latest, macos-latest, windows-latest]
  8. python-version: ['3.9', '3.10', '3.11', '3.12.3', '3.13.0', pypy-3.9]
  9. exclude:
  10. - os: windows-latest
  11. python-version: pypy-3.9
  12. runs-on: ${{ matrix.os }}
  13. steps:
  14. - uses: actions/checkout@v4
  15. - uses: actions/setup-python@v5
  16. with:
  17. python-version: ${{ matrix.python-version }}
  18. - name: Install Test dependencies
  19. run: pip install tox
  20. - name: Test
  21. run: tox -c pyproject.toml -e py
  22. - name: Install Coveralls
  23. if: github.event_name == 'push'
  24. run: pip install coveralls
  25. - name: Upload coverage to Coveralls
  26. if: github.event_name == 'push'
  27. env:
  28. COVERALLS_PARALLEL: true
  29. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  30. run: coveralls --service=github
  31. coveralls-finish:
  32. needs: test
  33. if: github.event_name == 'push'
  34. runs-on: ubuntu-latest
  35. continue-on-error: true
  36. steps:
  37. - uses: actions/setup-python@v5
  38. with:
  39. python-version: 3.x
  40. - name: Install Coveralls
  41. run: pip install coveralls
  42. - name: Finish Coveralls parallel builds
  43. env:
  44. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  45. run: coveralls --service=github --finish
  46. lint:
  47. runs-on: ubuntu-latest
  48. steps:
  49. - uses: actions/checkout@v4
  50. - uses: actions/setup-python@v5
  51. with:
  52. python-version: '3.12'
  53. - name: Install tox
  54. run: pip install tox
  55. - name: Lint
  56. run: tox -c pyproject.toml -e flake8,mypy,isort