1
0

python.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
  2. # shown in badge
  3. # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository
  4. name: tests
  5. on:
  6. push:
  7. pull_request:
  8. schedule:
  9. - cron: '0 20 * * 5'
  10. jobs:
  11. code-format:
  12. runs-on: ubuntu-20.04
  13. strategy:
  14. matrix:
  15. python-version: ['3.9']
  16. steps:
  17. - uses: actions/checkout@v4
  18. - uses: actions/setup-python@v5
  19. with:
  20. python-version: ${{ matrix.python-version }}
  21. # did not reduce runtime of `pipenv install` (still approx. 1 min)
  22. #cache: pipenv
  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-20.04
  31. strategy:
  32. matrix:
  33. python-version:
  34. - '3.8'
  35. - '3.9'
  36. - '3.10'
  37. - '3.11'
  38. fail-fast: false
  39. steps:
  40. - uses: actions/checkout@v4
  41. - uses: actions/setup-python@v5
  42. with:
  43. python-version: ${{ matrix.python-version }}
  44. # did not reduce runtime of `pipenv install` (still approx. 1 min)
  45. #cache: pipenv
  46. # with pipenv v2023.6.26:
  47. # > $ pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)"
  48. # . --cov-report=term-missing --cov-fail-under=100
  49. # > cat: '*.egg-info/top_level.txt': No such file or directory
  50. # > [...]
  51. # > [...]/coverage/inorout.py:507: CoverageWarning:
  52. # . Module was never imported. (module-not-imported)
  53. - run: pip install --upgrade pipenv==2023.6.18
  54. # by default pipenv picks the latest version in PATH
  55. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  56. env:
  57. PYTHON_VERSION: ${{ matrix.python-version }}
  58. - run: pipenv graph
  59. - run: pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)" --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-20.04
  73. steps:
  74. - uses: actions/checkout@v4
  75. - uses: actions/setup-python@v5
  76. with: {python-version: 3.9}
  77. - run: '! ical2vdir --help'
  78. - run: pip install wheel==0.37.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-20.04
  84. strategy:
  85. matrix:
  86. python-version: ['3.9']
  87. steps:
  88. - uses: actions/checkout@v4
  89. - uses: actions/setup-python@v5
  90. with:
  91. python-version: ${{ matrix.python-version }}
  92. - run: pip install --upgrade pipenv==2023.6.18
  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