test.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. continue-on-error: true
  55. steps:
  56. - uses: actions/setup-python@v5
  57. with:
  58. python-version: 3.x
  59. - name: Install Coveralls
  60. run: pip install coveralls
  61. - name: Finish Coveralls parallel builds
  62. env:
  63. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  64. run: coveralls --service=github --finish
  65. lint:
  66. runs-on: ubuntu-latest
  67. steps:
  68. - uses: actions/checkout@v4
  69. - uses: actions/setup-python@v5
  70. with:
  71. python-version: '3.13.0'
  72. - name: Install tox
  73. run: pip install tox
  74. - name: Lint
  75. run: tox -c pyproject.toml -e flake8,mypy,isort