python.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # sync with https://github.com/fphammerle/ical2vdir/blob/master/.github/workflows/python.yml
  2. # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
  3. # shown in badge
  4. # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository
  5. name: tests
  6. on:
  7. push:
  8. pull_request:
  9. schedule:
  10. - cron: '0 20 * * 5'
  11. jobs:
  12. code-format:
  13. runs-on: ubuntu-22.04
  14. strategy:
  15. matrix: {python-version: ['3.13']}
  16. steps:
  17. - uses: actions/checkout@v4
  18. - uses: actions/setup-python@v5
  19. with:
  20. python-version: ${{ matrix.python-version }}
  21. - run: pip install --upgrade pipenv==2024.1.0
  22. - run: sudo apt-get update
  23. # TODO exclude dbus-python & PyGObject from pipenv install
  24. - run: sudo apt-get install --yes --no-install-recommends
  25. libdbus-1-dev
  26. libgirepository1.0-dev
  27. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  28. env:
  29. PYTHON_VERSION: ${{ matrix.python-version }}
  30. - run: pipenv graph
  31. - run: pipenv run black --check .
  32. tests:
  33. runs-on: ubuntu-22.04
  34. strategy:
  35. matrix:
  36. python-version:
  37. - '3.9'
  38. - '3.10'
  39. - '3.11'
  40. - '3.12'
  41. - '3.13'
  42. fail-fast: false
  43. steps:
  44. - uses: actions/checkout@v4
  45. - uses: actions/setup-python@v5
  46. with:
  47. python-version: ${{ matrix.python-version }}
  48. # with pipenv v2023.6.26:
  49. # > $ pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)"
  50. # . --cov-report=term-missing --cov-fail-under=100
  51. # > cat: '*.egg-info/top_level.txt': No such file or directory
  52. # > [...]
  53. # > [...]/coverage/inorout.py:507: CoverageWarning:
  54. # . Module was never imported. (module-not-imported)
  55. - run: pip install --upgrade pipenv==2023.6.18
  56. - run: sudo apt-get update
  57. - run: sudo apt-get install --yes --no-install-recommends
  58. libdbus-1-dev
  59. libgirepository1.0-dev
  60. # by default pipenv picks the latest version in PATH
  61. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  62. env:
  63. PYTHON_VERSION: ${{ matrix.python-version }}
  64. - run: pipenv graph
  65. - run: >-
  66. pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)"
  67. --cov-report=term-missing --cov-fail-under=100
  68. - run: pipenv run pylint "$(cat *.egg-info/top_level.txt)"
  69. # https://github.com/PyCQA/pylint/issues/352
  70. - run: pipenv run pylint tests/*
  71. - run: pipenv run mypy "$(cat *.egg-info/top_level.txt)" tests