pythontest.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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.7", "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 --upgrade ruff
  38. python -m ruff check .
  39. - name: Typing checks
  40. run: |
  41. pip install --upgrade mypy types-paramiko types-requests
  42. python -m mypy dulwich
  43. if: "matrix.python-version != 'pypy3'"
  44. - name: Build
  45. run: |
  46. python setup.py build_ext -i
  47. - name: codespell
  48. run: |
  49. pip install --upgrade codespell
  50. codespell --config .codespellrc .
  51. - name: Coverage test suite run
  52. run: |
  53. pip install --upgrade coverage
  54. python -m coverage run -p -m unittest dulwich.tests.test_suite