diff --git a/.github/main.workflow b/.github/main.workflow index cec2d030b8a5d0..fed9496abd5867 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -1,19 +1,43 @@ -workflow "Tox" { +workflow "Python 3.7 - tox" { on = "push" - resolves = ["Python 3.7", "Python 3.6", "Python 3.5"] + resolves = ["Python 3.7 - tests"] } -action "Python 3.7" { +action "Python 3.7 - tests" { uses = "home-assistant/actions/py37-tox@master" - args = "-e lint,pylint,typing,cov" + args = "-e py37" } -action "Python 3.6" { +workflow "Python 3.6 - tox" { + on = "push" + resolves = ["Python 3.6 - tests"] +} + +action "Python 3.6 - tests" { uses = "home-assistant/actions/py36-tox@master" - args = "-e lint,pylint,typing" + args = "-e py36" +} + +workflow "Python 3.5 - tox" { + on = "push" + resolves = [ + "Pyton 3.5 - typing,cov", + ] +} + +action "Python 3.5 - tests" { + uses = "home-assistant/actions/py35-tox@master" + args = "-e py35" +} + +action "Python 3.5 - lints" { + uses = "home-assistant/actions/py35-tox@master" + needs = ["Python 3.5 - tests"] + args = "-e lint,pylint -p all" } -action "Python 3.5" { +action "Pyton 3.5 - typing,cov" { uses = "home-assistant/actions/py35-tox@master" - args = "-e lint,pylint,typing" + args = "-e typing,cov -p all" + needs = ["Python 3.5 - lints"] } diff --git a/tox.ini b/tox.ini index 1dfa77c14f162b..471deea0253f5a 100644 --- a/tox.ini +++ b/tox.ini @@ -3,14 +3,7 @@ envlist = py35, py36, py37, py38, lint, pylint, typing, cov skip_missing_interpreters = True [testenv] -setenv = - PYTHONPATH = {toxinidir}:{toxinidir}/homeassistant -; both temper-python and XBee modules have utf8 in their README files -; which get read in from setup.py. If we don't force our locale to a -; utf8 one, tox's env is reset. And the install of these 2 packages -; fail. -whitelist_externals = /usr/bin/env -install_command = /usr/bin/env LANG=C.UTF-8 pip install {opts} {packages} +basepython = {env:PYTHON3_PATH:python3} commands = pytest --timeout=9 --duration=10 {posargs} {toxinidir}/script/check_dirty @@ -19,15 +12,6 @@ deps = -c{toxinidir}/homeassistant/package_constraints.txt [testenv:cov] -basepython = {env:PYTHON3_PATH:python3} -setenv = - PYTHONPATH = {toxinidir}:{toxinidir}/homeassistant -; both temper-python and XBee modules have utf8 in their README files -; which get read in from setup.py. If we don't force our locale to a -; utf8 one, tox's env is reset. And the install of these 2 packages -; fail. -whitelist_externals = /usr/bin/env -install_command = /usr/bin/env LANG=C.UTF-8 pip install {opts} {packages} commands = pytest --timeout=9 --duration=10 --cov --cov-report= {posargs} {toxinidir}/script/check_dirty @@ -36,7 +20,6 @@ deps = -c{toxinidir}/homeassistant/package_constraints.txt [testenv:pylint] -basepython = {env:PYTHON3_PATH:python3} ignore_errors = True deps = -r{toxinidir}/requirements_all.txt @@ -46,18 +29,17 @@ commands = pylint {posargs} homeassistant [testenv:lint] -basepython = {env:PYTHON3_PATH:python3} deps = -r{toxinidir}/requirements_test.txt commands = - python script/gen_requirements_all.py validate - flake8 {posargs} - pydocstyle {posargs:homeassistant tests} + python script/gen_requirements_all.py validate + flake8 {posargs} + pydocstyle {posargs:homeassistant tests} [testenv:typing] -basepython = {env:PYTHON3_PATH:python3} whitelist_externals=/bin/bash deps = -r{toxinidir}/requirements_test.txt + -c{toxinidir}/homeassistant/package_constraints.txt commands = - /bin/bash -c 'mypy homeassistant/*.py homeassistant/{auth,util}/ homeassistant/helpers/{__init__,aiohttp_client,area_registry,condition,deprecation,dispatcher,entity_values,entityfilter,icon,intent,json,location,signal,state,sun,temperature,translation,typing}.py' + /bin/bash -c 'mypy homeassistant/*.py homeassistant/{auth,util}/ homeassistant/helpers/{__init__,aiohttp_client,area_registry,condition,deprecation,dispatcher,entity_values,entityfilter,icon,intent,json,location,signal,state,sun,temperature,translation,typing}.py'