python.yml 2.2 KB

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