pythontest.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.13'
  16. - '3.12'
  17. - '3.11'
  18. - '3.10'
  19. - '3.9'
  20. fail-fast: false
  21. steps:
  22. - uses: actions/checkout@v4
  23. - name: Set up Python ${{ matrix.python-version }}
  24. uses: actions/setup-python@v5
  25. with:
  26. python-version: ${{ matrix.python-version }}
  27. allow-prereleases: true
  28. cache: pip
  29. - name: Install native dependencies (Ubuntu)
  30. run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev
  31. if: "matrix.os == 'ubuntu-latest'"
  32. - name: Install native dependencies (MacOS)
  33. run: brew install swig gpgme
  34. if: "matrix.os == 'macos-latest'"
  35. - name: Install dependencies
  36. run: |
  37. python -m pip install --upgrade pip
  38. pip install --upgrade ".[fastimport,paramiko,https]" setuptools-rust
  39. - name: Install gpg on supported platforms
  40. run: pip install --upgrade ".[pgp]"
  41. if: "matrix.os != 'windows-latest' && matrix.python-version != 'pypy3'"
  42. - name: Style checks
  43. run: |
  44. pip install ".[dev]"
  45. python -m ruff check .
  46. python -m ruff format --check .
  47. - name: Typing checks
  48. run: |
  49. pip install --upgrade types-paramiko types-requests
  50. python -m mypy dulwich
  51. if: "matrix.python-version != 'pypy3'"
  52. - name: Build
  53. run: |
  54. python setup.py build_ext -i
  55. env:
  56. RUSTFLAGS: "-D warnings"
  57. - name: codespell
  58. run: |
  59. pip install --upgrade codespell
  60. codespell --config .codespellrc .
  61. - name: Coverage test suite run
  62. run: |
  63. pip install --upgrade coverage
  64. python -m coverage run -p -m unittest tests.test_suite