2
0

pythontest.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. name: Python tests
  2. on:
  3. push:
  4. branches: [ main, master ]
  5. pull_request:
  6. schedule:
  7. - cron: "0 6 * * *" # Daily 6AM UTC build
  8. jobs:
  9. test:
  10. runs-on: ${{ matrix.os }}
  11. strategy:
  12. matrix:
  13. os: [ubuntu-latest, macos-latest, windows-latest]
  14. python-version:
  15. ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
  16. fail-fast: false
  17. steps:
  18. - uses: actions/checkout@v4
  19. - name: Set up Python ${{ matrix.python-version }}
  20. uses: actions/setup-python@v5
  21. with:
  22. python-version: ${{ matrix.python-version }}
  23. allow-prereleases: true
  24. cache: pip
  25. - name: Install native dependencies (Ubuntu)
  26. run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev
  27. if: "matrix.os == 'ubuntu-latest'"
  28. - name: Install native dependencies (MacOS)
  29. run: brew install swig gpgme
  30. if: "matrix.os == 'macos-latest'"
  31. - name: Install dependencies
  32. run: |
  33. python -m pip install --upgrade pip
  34. pip install --upgrade ".[fastimport,paramiko,https]" setuptools-rust
  35. - name: Install gpg on supported platforms
  36. run: pip install --upgrade ".[pgp]"
  37. if: "matrix.os != 'windows-latest' && matrix.python-version != 'pypy3'"
  38. - name: Style checks
  39. run: |
  40. pip install ".[dev]"
  41. python -m ruff check .
  42. python -m ruff format --check .
  43. - name: Typing checks
  44. run: |
  45. pip install --upgrade types-paramiko types-requests
  46. python -m mypy dulwich
  47. if: "matrix.python-version != 'pypy3'"
  48. - name: Build
  49. run: |
  50. python setup.py build_ext -i
  51. - name: codespell
  52. run: |
  53. pip install --upgrade codespell
  54. codespell --config .codespellrc .
  55. - name: Coverage test suite run
  56. run: |
  57. pip install --upgrade coverage
  58. python -m coverage run -p -m unittest tests.test_suite