python.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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@v5
  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@v5
  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. install:
  74. runs-on: ubuntu-24.04
  75. steps:
  76. - uses: actions/checkout@v5
  77. - uses: actions/setup-python@v6
  78. with: {python-version: 3.11}
  79. - run: '! ical2vdir --help'
  80. - run: pip install wheel==0.45.1
  81. - run: python setup.py bdist_wheel
  82. - run: pip install dist/*.whl
  83. - run: ical2vdir --help
  84. check-links:
  85. runs-on: ubuntu-24.04
  86. strategy:
  87. matrix:
  88. python-version: ['3.13']
  89. steps:
  90. - uses: actions/checkout@v5
  91. - uses: actions/setup-python@v6
  92. with:
  93. python-version: ${{ matrix.python-version }}
  94. - run: pip install --upgrade pipenv==2025.0.4
  95. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  96. env:
  97. PYTHON_VERSION: ${{ matrix.python-version }}
  98. - run: pipenv graph
  99. # `--include '*.md'` fails for https://securipi.co.uk/cc1101.pdf (HTTP403).
  100. # `--include '*.py'` identifies `logging.INFO` as an url.
  101. - run: pipenv run blinkcheck --include CHANGELOG.md