python.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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.11']
  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. fail-fast: false
  38. steps:
  39. - uses: actions/checkout@v5
  40. - uses: actions/setup-python@v6
  41. with:
  42. python-version: ${{ matrix.python-version }}
  43. # did not reduce runtime of `pipenv install` (still approx. 1 min)
  44. #cache: pipenv
  45. # with pipenv v2023.6.26:
  46. # > $ pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)"
  47. # . --cov-report=term-missing --cov-fail-under=100
  48. # > cat: '*.egg-info/top_level.txt': No such file or directory
  49. # > [...]
  50. # > [...]/coverage/inorout.py:507: CoverageWarning:
  51. # . Module was never imported. (module-not-imported)
  52. - run: pip install --upgrade pipenv==2023.6.18
  53. # by default pipenv picks the latest version in PATH
  54. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  55. env:
  56. PYTHON_VERSION: ${{ matrix.python-version }}
  57. - run: pipenv graph
  58. - run: pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)"
  59. --cov-report=term-missing --cov-fail-under=100
  60. - run: pipenv run pylint "$(cat *.egg-info/top_level.txt)"
  61. # workaround pylint reporting:
  62. # > E0401: Unable to import 'ical2vdir' (import-error)
  63. # pyproject.toml broken?
  64. - run: >-
  65. printenv GITHUB_WORKSPACE
  66. | tee "$(pipenv --venv)/lib/python${PYTHON_VERSION}/site-packages/easy-install.pth"
  67. env:
  68. PYTHON_VERSION: ${{ matrix.python-version }}
  69. - run: pipenv run pylint tests
  70. - run: pipenv run mypy "$(cat *.egg-info/top_level.txt)" tests
  71. install:
  72. runs-on: ubuntu-24.04
  73. steps:
  74. - uses: actions/checkout@v5
  75. - uses: actions/setup-python@v6
  76. with: {python-version: 3.11}
  77. - run: '! ical2vdir --help'
  78. - run: pip install wheel==0.45.1
  79. - run: python setup.py bdist_wheel
  80. - run: pip install dist/*.whl
  81. - run: ical2vdir --help
  82. check-links:
  83. runs-on: ubuntu-24.04
  84. strategy:
  85. matrix:
  86. python-version: ['3.11']
  87. steps:
  88. - uses: actions/checkout@v5
  89. - uses: actions/setup-python@v6
  90. with:
  91. python-version: ${{ matrix.python-version }}
  92. - run: pip install --upgrade pipenv==2025.0.4
  93. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  94. env:
  95. PYTHON_VERSION: ${{ matrix.python-version }}
  96. - run: pipenv graph
  97. # `--include '*.md'` fails for https://securipi.co.uk/cc1101.pdf (HTTP403).
  98. # `--include '*.py'` identifies `logging.INFO` as an url.
  99. - run: pipenv run blinkcheck --include CHANGELOG.md