test.yml 1.7 KB

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