1
0

python.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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.11']
  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==2024.1.0
  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.9'
  35. - '3.10'
  36. - '3.11'
  37. fail-fast: false
  38. steps:
  39. - uses: actions/checkout@v4
  40. - uses: actions/setup-python@v5
  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: >-
  59. pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)"
  60. --cov-report=term-missing --cov-fail-under=100
  61. - run: pipenv run pylint "$(cat *.egg-info/top_level.txt)"
  62. # workaround pylint reporting:
  63. # > E0401: Unable to import 'ical2vdir' (import-error)
  64. # pyproject.toml broken?
  65. - run: >-
  66. printenv GITHUB_WORKSPACE
  67. | tee "$(pipenv --venv)/lib/python${PYTHON_VERSION}/site-packages/easy-install.pth"
  68. env:
  69. PYTHON_VERSION: ${{ matrix.python-version }}
  70. - run: pipenv run pylint tests
  71. - run: pipenv run mypy "$(cat *.egg-info/top_level.txt)" tests
  72. install:
  73. runs-on: ubuntu-20.04
  74. steps:
  75. - uses: actions/checkout@v4
  76. - uses: actions/setup-python@v5
  77. with: {python-version: 3.9}
  78. - run: '! ical2vdir --help'
  79. - run: pip install wheel==0.37.1
  80. - run: python setup.py bdist_wheel
  81. - run: pip install dist/*.whl
  82. - run: ical2vdir --help
  83. check-links:
  84. runs-on: ubuntu-20.04
  85. strategy:
  86. matrix:
  87. python-version: ['3.9']
  88. steps:
  89. - uses: actions/checkout@v4
  90. - uses: actions/setup-python@v5
  91. with:
  92. python-version: ${{ matrix.python-version }}
  93. - run: pip install --upgrade pipenv==2024.1.0
  94. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  95. env:
  96. PYTHON_VERSION: ${{ matrix.python-version }}
  97. - run: pipenv graph
  98. # `--include '*.md'` fails for https://securipi.co.uk/cc1101.pdf (HTTP403).
  99. # `--include '*.py'` identifies `logging.INFO` as an url.
  100. - run: pipenv run blinkcheck --include CHANGELOG.md