python.yml 3.6 KB

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