test.yml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. name: Test
  2. on: [push, pull_request]
  3. jobs:
  4. test-python-latest:
  5. needs: lint
  6. strategy:
  7. matrix:
  8. os: [ubuntu-latest, macos-latest, windows-latest]
  9. python-version: ['3.14']
  10. runs-on: ${{ matrix.os }}
  11. steps:
  12. - uses: actions/checkout@v4
  13. - uses: actions/setup-python@v5
  14. with:
  15. python-version: ${{ matrix.python-version }}
  16. - name: Install Test dependencies
  17. run: pip install tox
  18. - name: Test with latest Python
  19. run: tox -c pyproject.toml -e py
  20. test:
  21. needs: test-python-latest
  22. strategy:
  23. matrix:
  24. os: [ubuntu-latest, macos-latest, windows-latest]
  25. python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', pypy-3.9', 'pypy-3.10', 'pypy-3.11']
  26. exclude:
  27. - os: windows-latest
  28. python-version: 'pypy-3.9'
  29. - os: windows-latest
  30. python-version: 'pypy-3.10'
  31. - os: windows-latest
  32. python-version: 'pypy-3.11'
  33. runs-on: ${{ matrix.os }}
  34. steps:
  35. - uses: actions/checkout@v4
  36. - uses: actions/setup-python@v5
  37. with:
  38. python-version: ${{ matrix.python-version }}
  39. - name: Install Test dependencies
  40. run: pip install tox
  41. - name: Test with older Python
  42. run: tox -c pyproject.toml -e py
  43. coveralls-test:
  44. if: github.event_name == 'push'
  45. strategy:
  46. matrix:
  47. os: [ubuntu-latest]
  48. python-version: ['3.13']
  49. runs-on: ${{ matrix.os }}
  50. steps:
  51. - uses: actions/checkout@v4
  52. - uses: actions/setup-python@v5
  53. with:
  54. python-version: ${{ matrix.python-version }}
  55. - name: Install Test dependencies
  56. run: pip install tox
  57. - name: Test
  58. run: tox -c pyproject.toml -e py
  59. - name: Install Coveralls
  60. if: github.event_name == 'push'
  61. run: pip install coveralls
  62. - name: Upload coverage to Coveralls
  63. if: github.event_name == 'push'
  64. env:
  65. COVERALLS_PARALLEL: true
  66. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  67. run: coveralls --service=github
  68. coveralls-finish:
  69. needs: coveralls-test
  70. if: github.event_name == 'push'
  71. runs-on: ubuntu-latest
  72. steps:
  73. - uses: actions/setup-python@v5
  74. with:
  75. python-version: 3.x
  76. - name: Install Coveralls
  77. run: pip install coveralls
  78. - name: Finish Coveralls parallel builds
  79. env:
  80. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  81. run: coveralls --service=github --finish
  82. lint:
  83. runs-on: ubuntu-latest
  84. steps:
  85. - uses: actions/checkout@v4
  86. - uses: actions/setup-python@v5
  87. with:
  88. python-version: '3.13'
  89. - name: Install tox
  90. run: pip install tox
  91. - name: Lint
  92. run: tox -c pyproject.toml -e flake8,mypy,isort