python.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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-18.04
  13. strategy:
  14. matrix:
  15. python-version:
  16. - 3.8
  17. steps:
  18. - uses: actions/checkout@v1
  19. - &setup_python
  20. uses: actions/setup-python@v1
  21. with:
  22. python-version: ${{ matrix.python-version }}
  23. - &pip_install_pipenv
  24. run: pip install --upgrade pipenv>=2018.10.9
  25. - &pipenv_install
  26. run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  27. env:
  28. PYTHON_VERSION: ${{ matrix.python-version }}
  29. - run: pipenv graph
  30. - run: pipenv run black --check .
  31. tests:
  32. runs-on: ubuntu-18.04
  33. strategy:
  34. matrix:
  35. python-version:
  36. - 3.5
  37. - 3.6
  38. - 3.7
  39. - 3.8
  40. steps:
  41. - uses: actions/checkout@v1
  42. - *setup_python
  43. - *pip_install_pipenv
  44. - *pipenv_install
  45. - run: pipenv graph
  46. - run: pipenv run pytest --cov=ical2vdir --cov-report=term-missing --cov-fail-under=100
  47. - run: pipenv run pylint --load-plugins=pylint_import_requirements ical2vdir
  48. # https://github.com/PyCQA/pylint/issues/352
  49. # disable parse-error due to:
  50. # > tests/resources/__init__.py:1:0: F0010: error while code parsing: Unable to load file tests/resources/__init__.py:
  51. # > [Errno 2] No such file or directory: 'tests/resources/__init__.py' (parse-error)
  52. - run: pipenv run pylint --disable=parse-error tests/*
  53. - run: pipenv run mypy ical2vdir tests
  54. # >=1.9.0 to detect branch name
  55. # https://github.com/coveralls-clients/coveralls-python/pull/207
  56. # https://github.com/coverallsapp/github-action/issues/4#issuecomment-547036866
  57. # 1.11.0 https://github.com/coveralls-clients/coveralls-python/issues/219
  58. - run: pip install 'coveralls>=1.9.0,<2,!=1.11.0'
  59. # https://github.com/coverallsapp/github-action/issues/30
  60. # https://github.com/coverallsapp/github-action/issues/4#issuecomment-529399410
  61. - run: coveralls
  62. env:
  63. COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}