pythontest.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. - name: Install native dependencies (Ubuntu)
  24. run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev
  25. if: "matrix.os == 'ubuntu-latest'"
  26. - name: Install native dependencies (MacOS)
  27. run: brew install swig gpgme
  28. if: "matrix.os == 'macos-latest'"
  29. - name: Install dependencies
  30. run: |
  31. python -m pip install --upgrade pip
  32. pip install --upgrade ".[fastimport,paramiko,https]" setuptools-rust
  33. - name: Install gpg on supported platforms
  34. run: pip install --upgrade ".[pgp]"
  35. if: "matrix.os != 'windows-latest' && matrix.python-version != 'pypy3'"
  36. - name: Style checks
  37. run: |
  38. pip install ".[dev]"
  39. python -m ruff check .
  40. python -m ruff format --check .
  41. - name: Typing checks
  42. run: |
  43. pip install --upgrade mypy types-paramiko types-requests
  44. python -m mypy dulwich
  45. if: "matrix.python-version != 'pypy3'"
  46. - name: Build
  47. run: |
  48. python setup.py build_ext -i
  49. - name: codespell
  50. run: |
  51. pip install --upgrade codespell
  52. codespell --config .codespellrc .
  53. - name: Coverage test suite run
  54. run: |
  55. pip install --upgrade coverage
  56. python -m coverage run -p -m unittest tests.test_suite