python.yml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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@v3
  18. - uses: actions/setup-python@v4
  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==2022.9.21
  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@v3
  41. - uses: actions/setup-python@v4
  42. with:
  43. python-version: ${{ matrix.python-version }}
  44. # did not reduce runtime of `pipenv install` (still approx. 1 min)
  45. #cache: pipenv
  46. - run: pip install --upgrade pipenv==2022.9.21
  47. # by default pipenv picks the latest version in PATH
  48. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  49. env:
  50. PYTHON_VERSION: ${{ matrix.python-version }}
  51. - run: pipenv graph
  52. - run: pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)" --cov-report=term-missing --cov-fail-under=100
  53. - run: pipenv run pylint --load-plugins=pylint_import_requirements "$(cat *.egg-info/top_level.txt)"
  54. # workaround pylint reporting:
  55. # > E0401: Unable to import 'ical2vdir' (import-error)
  56. # pyproject.toml broken?
  57. - run: >-
  58. printenv GITHUB_WORKSPACE
  59. | tee "$(pipenv --venv)/lib/python${PYTHON_VERSION}/site-packages/easy-install.pth"
  60. env:
  61. PYTHON_VERSION: ${{ matrix.python-version }}
  62. - run: pipenv run pylint tests
  63. - run: pipenv run mypy "$(cat *.egg-info/top_level.txt)" tests
  64. install:
  65. runs-on: ubuntu-20.04
  66. steps:
  67. - uses: actions/checkout@v3
  68. - uses: actions/setup-python@v4
  69. with: {python-version: 3.9}
  70. - run: '! ical2vdir --help'
  71. - run: pip install wheel==0.37.1
  72. - run: python setup.py bdist_wheel
  73. - run: pip install dist/*.whl
  74. - run: ical2vdir --help
  75. check-links:
  76. runs-on: ubuntu-20.04
  77. strategy:
  78. matrix:
  79. python-version: ['3.9']
  80. steps:
  81. - uses: actions/checkout@v3
  82. - uses: actions/setup-python@v4
  83. with:
  84. python-version: ${{ matrix.python-version }}
  85. - run: pip install --upgrade pipenv==2022.9.21
  86. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  87. env:
  88. PYTHON_VERSION: ${{ matrix.python-version }}
  89. - run: pipenv graph
  90. # `--include '*.md'` fails for https://securipi.co.uk/cc1101.pdf (HTTP403).
  91. # `--include '*.py'` identifies `logging.INFO` as an url.
  92. - run: pipenv run blinkcheck --include CHANGELOG.md