python.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # sync with https://github.com/fphammerle/ical2vdir/blob/master/.github/workflows/python.yml
  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. build:
  12. runs-on: ubuntu-18.04
  13. strategy:
  14. matrix:
  15. python-version:
  16. - 3.5
  17. - 3.6
  18. - 3.7
  19. - 3.8
  20. steps:
  21. - uses: actions/checkout@v1
  22. - uses: actions/setup-python@v1
  23. with:
  24. python-version: ${{ matrix.python-version }}
  25. - run: pip install --upgrade pipenv>=2018.10.9
  26. - run: sudo apt-get install --yes --no-install-recommends libdbus-1-dev
  27. - run: pipenv install --deploy --dev
  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 pylint --load-plugins=pylint_import_requirements systemctl_mqtt
  36. # https://github.com/PyCQA/pylint/issues/352
  37. - run: pipenv run pylint tests/*
  38. - run: pipenv run mypy systemctl_mqtt tests
  39. - run: pipenv run pytest --cov=systemctl_mqtt --cov-report=term-missing --cov-fail-under=100
  40. - run: pipenv run black --check .
  41. # >=1.9.0 to detect branch name
  42. # https://github.com/coveralls-clients/coveralls-python/pull/207
  43. # https://github.com/coverallsapp/github-action/issues/4#issuecomment-547036866
  44. # 1.11.0 https://github.com/coveralls-clients/coveralls-python/issues/219
  45. - run: pip install 'coveralls>=1.9.0,<2,!=1.11.0'
  46. # https://github.com/coverallsapp/github-action/issues/30
  47. # https://github.com/coverallsapp/github-action/issues/4#issuecomment-529399410
  48. - run: coveralls
  49. env:
  50. COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}