python.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. ---
  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-24.04
  14. strategy:
  15. matrix:
  16. python-version: ['3.13']
  17. steps:
  18. - uses: actions/checkout@v6
  19. - uses: actions/setup-python@v6
  20. with:
  21. python-version: ${{ matrix.python-version }}
  22. # did not reduce runtime of `pipenv install` (still approx. 1 min)
  23. #cache: pipenv
  24. - run: pip install --upgrade pipenv==2025.0.4
  25. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  26. env:
  27. PYTHON_VERSION: ${{ matrix.python-version }}
  28. - run: pipenv graph
  29. - run: pipenv run black --check .
  30. tests:
  31. runs-on: ubuntu-24.04
  32. strategy:
  33. matrix:
  34. python-version:
  35. - '3.10'
  36. - '3.11'
  37. - '3.12'
  38. - '3.13'
  39. fail-fast: false
  40. steps:
  41. - uses: actions/checkout@v6
  42. - uses: actions/setup-python@v6
  43. with:
  44. python-version: ${{ matrix.python-version }}
  45. # did not reduce runtime of `pipenv install` (still approx. 1 min)
  46. #cache: pipenv
  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. # by default pipenv picks the latest version in PATH
  56. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  57. env:
  58. PYTHON_VERSION: ${{ matrix.python-version }}
  59. - run: pipenv graph
  60. - run: pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)"
  61. --cov-report=term-missing --cov-fail-under=100
  62. - run: pipenv run pylint "$(cat *.egg-info/top_level.txt)"
  63. # workaround pylint reporting:
  64. # > E0401: Unable to import 'ical2vdir' (import-error)
  65. # pyproject.toml broken?
  66. - run: >-
  67. printenv GITHUB_WORKSPACE
  68. | tee "$(pipenv --venv)/lib/python${PYTHON_VERSION}/site-packages/easy-install.pth"
  69. env:
  70. PYTHON_VERSION: ${{ matrix.python-version }}
  71. - run: pipenv run pylint tests
  72. - run: pipenv run mypy "$(cat *.egg-info/top_level.txt)" tests
  73. tests-icalendar:
  74. runs-on: ubuntu-24.04
  75. strategy:
  76. matrix:
  77. python-version: ['3.10']
  78. icalendar-version: ['4.1.2', '5.0.14']
  79. steps:
  80. - uses: actions/checkout@v6
  81. - uses: actions/setup-python@v6
  82. with: {python-version: '${{ matrix.python-version }}'}
  83. - run: pip install --upgrade pipenv==2023.6.18
  84. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  85. env: {PYTHON_VERSION: '${{ matrix.python-version }}'}
  86. - run: pipenv run pip install icalendar==${{ matrix.icalendar-version }}
  87. - run: pipenv graph
  88. - run: pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)"
  89. --cov-report=term-missing --cov-fail-under=100
  90. install:
  91. runs-on: ubuntu-24.04
  92. steps:
  93. - uses: actions/checkout@v6
  94. - uses: actions/setup-python@v6
  95. with: {python-version: 3.11}
  96. - run: '! ical2vdir --help'
  97. - run: pip install wheel==0.45.1
  98. - run: python setup.py bdist_wheel
  99. - run: pip install dist/*.whl
  100. - run: ical2vdir --help
  101. check-links:
  102. runs-on: ubuntu-24.04
  103. strategy:
  104. matrix:
  105. python-version: ['3.13']
  106. steps:
  107. - uses: actions/checkout@v6
  108. - uses: actions/setup-python@v6
  109. with:
  110. python-version: ${{ matrix.python-version }}
  111. - run: pip install --upgrade pipenv==2025.0.4
  112. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  113. env:
  114. PYTHON_VERSION: ${{ matrix.python-version }}
  115. - run: pipenv graph
  116. # `--include '*.md'` fails for https://securipi.co.uk/cc1101.pdf (HTTP403).
  117. # `--include '*.py'` identifies `logging.INFO` as an url.
  118. - run: pipenv run blinkcheck --include CHANGELOG.md