test.yml 2.2 KB

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