Skip to content

Commit

Permalink
GitHub Workflow (home-assistant#21643)
Browse files Browse the repository at this point in the history
* Fix tox.ini

* Update main.workflow

* Update tox.ini

* Update main.workflow

* Update main.workflow

* Update tox.ini

* Try only with one

* Update main.workflow

* Update main.workflow

* Update main.workflow

* Update main.workflow

* Update main.workflow
  • Loading branch information
pvizeli authored Mar 4, 2019
1 parent 5c9f266 commit c60627c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 32 deletions.
40 changes: 32 additions & 8 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -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"]
}
30 changes: 6 additions & 24 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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'

0 comments on commit c60627c

Please sign in to comment.