test.yml 2.1 KB

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