2
0

pythontest.yml 1.9 KB

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