test.yml 2.1 KB

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