pythontest.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. env:
  52. RUSTFLAGS: "-D warnings"
  53. - name: codespell
  54. run: |
  55. pip install --upgrade codespell
  56. codespell --config .codespellrc .
  57. - name: Coverage test suite run
  58. run: |
  59. pip install --upgrade coverage
  60. python -m coverage run -p -m unittest tests.test_suite