1
0

python.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # shown in badge
  2. # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository
  3. name: tests
  4. on:
  5. push:
  6. pull_request:
  7. schedule:
  8. - cron: '0 20 * * 5'
  9. jobs:
  10. build:
  11. runs-on: ubuntu-18.04
  12. strategy:
  13. matrix:
  14. python-version:
  15. - 3.5
  16. - 3.6
  17. - 3.7
  18. - 3.8
  19. steps:
  20. - uses: actions/checkout@v1
  21. - uses: actions/setup-python@v1
  22. with:
  23. python-version: ${{ matrix.python-version }}
  24. - run: pip install --upgrade pipenv>=2018.10.9
  25. - run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
  26. env:
  27. PYTHON_VERSION: ${{ matrix.python-version }}
  28. # ModuleNotFoundError: No module named 'importlib_metadata'
  29. # https://github.com/WanzenBug/pylint-import-requirements/issues/17
  30. - run: if python3 -c 'import sys; sys.exit(sys.version_info < (3, 8))'; then
  31. pipenv graph;
  32. pipenv install --dev importlib-metadata;
  33. fi
  34. - run: pipenv graph
  35. - run: pipenv run pytest --cov=ical2vdir --cov-report=term-missing --cov-fail-under=100
  36. - run: pipenv run pylint --load-plugins=pylint_import_requirements ical2vdir
  37. # https://github.com/PyCQA/pylint/issues/352
  38. # disable parse-error due to:
  39. # > tests/resources/__init__.py:1:0: F0010: error while code parsing: Unable to load file tests/resources/__init__.py:
  40. # > [Errno 2] No such file or directory: 'tests/resources/__init__.py' (parse-error)
  41. - run: pipenv run pylint --disable=parse-error tests/*
  42. - run: pipenv run mypy ical2vdir tests
  43. # >=1.9.0 to detect branch name
  44. # https://github.com/coveralls-clients/coveralls-python/pull/207
  45. # https://github.com/coverallsapp/github-action/issues/4#issuecomment-547036866
  46. # 1.11.0 https://github.com/coveralls-clients/coveralls-python/issues/219
  47. - run: pip install 'coveralls>=1.9.0,<2,!=1.11.0'
  48. # https://github.com/coverallsapp/github-action/issues/30
  49. # https://github.com/coverallsapp/github-action/issues/4#issuecomment-529399410
  50. - run: coveralls
  51. env:
  52. COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}