python.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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-20.04
  14. strategy:
  15. matrix:
  16. python-version: ['3.9']
  17. steps:
  18. - uses: actions/checkout@v4
  19. - uses: actions/setup-python@v5
  20. with:
  21. python-version: ${{ matrix.python-version }}
  22. - run: pip install --upgrade pipenv==2023.6.18
  23. - run: sudo apt-get update
  24. # TODO exclude dbus-python & PyGObject from pipenv install
  25. - run: sudo apt-get install --yes --no-install-recommends
  26. libdbus-1-dev
  27. libgirepository1.0-dev
  28. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  29. env:
  30. PYTHON_VERSION: ${{ matrix.python-version }}
  31. - run: pipenv graph
  32. - run: pipenv run black --check .
  33. tests:
  34. runs-on: ubuntu-20.04
  35. strategy:
  36. matrix:
  37. python-version:
  38. - '3.8'
  39. - '3.9'
  40. - '3.10'
  41. fail-fast: false
  42. steps:
  43. - uses: actions/checkout@v4
  44. - uses: actions/setup-python@v5
  45. with:
  46. python-version: ${{ matrix.python-version }}
  47. # with pipenv v2023.6.26:
  48. # > $ pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)"
  49. # . --cov-report=term-missing --cov-fail-under=100
  50. # > cat: '*.egg-info/top_level.txt': No such file or directory
  51. # > [...]
  52. # > [...]/coverage/inorout.py:507: CoverageWarning:
  53. # . Module was never imported. (module-not-imported)
  54. - run: pip install --upgrade pipenv==2023.6.18
  55. - run: sudo apt-get update
  56. - run: sudo apt-get install --yes --no-install-recommends
  57. libdbus-1-dev
  58. libgirepository1.0-dev
  59. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  60. env:
  61. PYTHON_VERSION: ${{ matrix.python-version }}
  62. - run: pipenv graph
  63. - run: pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)" --cov-report=term-missing --cov-fail-under=100
  64. - run: pipenv run pylint "$(cat *.egg-info/top_level.txt)"
  65. # https://github.com/PyCQA/pylint/issues/352
  66. - run: pipenv run pylint tests/*
  67. - run: pipenv run mypy "$(cat *.egg-info/top_level.txt)" tests