pythontest.yml 1.9 KB

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