2019-06-07 18:38:05 +02:00
|
|
|
# https://dev.azure.com/home-assistant
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
batch: true
|
|
|
|
branches:
|
|
|
|
include:
|
2019-07-18 23:19:52 +02:00
|
|
|
- rc
|
2019-06-07 18:38:05 +02:00
|
|
|
- dev
|
2019-07-18 23:19:52 +02:00
|
|
|
- master
|
2019-07-12 09:29:55 +02:00
|
|
|
pr:
|
2019-07-18 23:19:52 +02:00
|
|
|
- rc
|
2019-07-12 09:29:55 +02:00
|
|
|
- dev
|
2019-07-18 23:19:52 +02:00
|
|
|
- master
|
2019-06-09 11:11:29 +02:00
|
|
|
|
2019-06-09 14:26:42 +02:00
|
|
|
resources:
|
|
|
|
containers:
|
|
|
|
- container: 37
|
|
|
|
image: homeassistant/ci-azure:3.7
|
2019-08-04 14:32:35 +02:00
|
|
|
repositories:
|
|
|
|
- repository: azure
|
|
|
|
type: github
|
|
|
|
name: 'home-assistant/ci-azure'
|
|
|
|
endpoint: 'home-assistant'
|
2019-06-07 21:16:39 +02:00
|
|
|
variables:
|
2019-06-09 11:11:29 +02:00
|
|
|
- name: PythonMain
|
2019-12-16 07:29:19 +01:00
|
|
|
value: '37'
|
2019-07-12 11:27:31 +02:00
|
|
|
- group: codecov
|
2019-06-07 21:16:39 +02:00
|
|
|
|
2019-06-28 19:35:17 +02:00
|
|
|
stages:
|
|
|
|
|
|
|
|
- stage: 'Overview'
|
|
|
|
jobs:
|
|
|
|
- job: 'Lint'
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
container: $[ variables['PythonMain'] ]
|
|
|
|
steps:
|
2019-10-16 17:11:25 +02:00
|
|
|
- template: templates/azp-step-cache.yaml@azure
|
|
|
|
parameters:
|
|
|
|
keyfile: 'requirements_test.txt | homeassistant/package_constraints.txt'
|
|
|
|
build: |
|
|
|
|
python -m venv venv
|
2019-06-28 22:08:29 +02:00
|
|
|
|
2019-10-16 17:11:25 +02:00
|
|
|
. venv/bin/activate
|
|
|
|
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
|
2019-11-02 20:21:09 +01:00
|
|
|
pre-commit install-hooks --config .pre-commit-config-all.yaml
|
2019-06-28 22:08:29 +02:00
|
|
|
- script: |
|
2019-06-28 22:18:52 +02:00
|
|
|
. venv/bin/activate
|
2019-10-18 21:20:27 +02:00
|
|
|
pre-commit run flake8 --all-files
|
2019-06-28 19:35:17 +02:00
|
|
|
displayName: 'Run flake8'
|
2019-11-18 09:10:15 +01:00
|
|
|
- script: |
|
|
|
|
. venv/bin/activate
|
|
|
|
pre-commit run bandit --all-files
|
|
|
|
displayName: 'Run bandit'
|
2019-12-12 15:58:47 +01:00
|
|
|
- script: |
|
|
|
|
. venv/bin/activate
|
2019-12-20 22:00:31 +01:00
|
|
|
pre-commit run isort --all-files --show-diff-on-failure
|
2019-12-12 15:58:47 +01:00
|
|
|
displayName: 'Run isort'
|
2019-12-16 11:06:17 +01:00
|
|
|
- script: |
|
|
|
|
. venv/bin/activate
|
|
|
|
pre-commit run check-json --all-files
|
|
|
|
displayName: 'Run check-json'
|
2019-06-28 22:08:29 +02:00
|
|
|
- job: 'Validate'
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
container: $[ variables['PythonMain'] ]
|
|
|
|
steps:
|
2019-10-16 17:11:25 +02:00
|
|
|
- template: templates/azp-step-cache.yaml@azure
|
|
|
|
parameters:
|
|
|
|
keyfile: 'homeassistant/package_constraints.txt'
|
|
|
|
build: |
|
|
|
|
python -m venv venv
|
2019-06-28 22:08:29 +02:00
|
|
|
|
2019-10-16 17:11:25 +02:00
|
|
|
. venv/bin/activate
|
|
|
|
pip install -e .
|
2019-06-28 22:08:29 +02:00
|
|
|
- script: |
|
|
|
|
. venv/bin/activate
|
|
|
|
python -m script.hassfest validate
|
|
|
|
displayName: 'Validate manifests'
|
|
|
|
- script: |
|
|
|
|
. venv/bin/activate
|
2019-06-28 22:18:52 +02:00
|
|
|
./script/gen_requirements_all.py validate
|
2019-06-28 22:08:29 +02:00
|
|
|
displayName: 'requirements_all validate'
|
2019-07-31 01:59:12 +02:00
|
|
|
- job: 'CheckFormat'
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
container: $[ variables['PythonMain'] ]
|
|
|
|
steps:
|
2019-10-16 17:11:25 +02:00
|
|
|
- template: templates/azp-step-cache.yaml@azure
|
|
|
|
parameters:
|
|
|
|
keyfile: 'requirements_test.txt | homeassistant/package_constraints.txt'
|
|
|
|
build: |
|
|
|
|
python -m venv venv
|
2019-07-31 01:59:12 +02:00
|
|
|
|
2019-10-16 17:11:25 +02:00
|
|
|
. venv/bin/activate
|
|
|
|
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
|
2019-11-02 20:21:09 +01:00
|
|
|
pre-commit install-hooks --config .pre-commit-config-all.yaml
|
2019-07-31 01:59:12 +02:00
|
|
|
- script: |
|
|
|
|
. venv/bin/activate
|
2019-12-20 22:00:31 +01:00
|
|
|
pre-commit run black --all-files --show-diff-on-failure
|
2019-07-31 01:59:12 +02:00
|
|
|
displayName: 'Check Black formatting'
|
2019-06-28 19:35:17 +02:00
|
|
|
|
|
|
|
- stage: 'Tests'
|
2019-06-09 11:11:29 +02:00
|
|
|
dependsOn:
|
2019-06-28 19:35:17 +02:00
|
|
|
- 'Overview'
|
|
|
|
jobs:
|
2019-06-28 22:08:29 +02:00
|
|
|
- job: 'PyTest'
|
2019-06-28 19:35:17 +02:00
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
strategy:
|
|
|
|
maxParallel: 3
|
|
|
|
matrix:
|
|
|
|
Python37:
|
|
|
|
python.container: '37'
|
|
|
|
container: $[ variables['python.container'] ]
|
|
|
|
steps:
|
2019-08-04 14:32:35 +02:00
|
|
|
- template: templates/azp-step-cache.yaml@azure
|
|
|
|
parameters:
|
2019-10-19 12:31:40 +02:00
|
|
|
keyfile: 'requirements_test_all.txt | homeassistant/package_constraints.txt'
|
2019-08-04 14:32:35 +02:00
|
|
|
build: |
|
|
|
|
set -e
|
|
|
|
python -m venv venv
|
2019-07-31 01:44:39 +02:00
|
|
|
|
2019-08-04 14:32:35 +02:00
|
|
|
. venv/bin/activate
|
2019-10-19 05:51:53 +02:00
|
|
|
pip install -U pip setuptools pytest-azurepipelines pytest-xdist -c homeassistant/package_constraints.txt
|
2019-08-04 14:32:35 +02:00
|
|
|
pip install -r requirements_test_all.txt -c homeassistant/package_constraints.txt
|
|
|
|
# This is a TEMP. Eventually we should make sure our 4 dependencies drop typing.
|
|
|
|
# Find offending deps with `pipdeptree -r -p typing`
|
|
|
|
pip uninstall -y typing
|
2019-10-16 17:11:25 +02:00
|
|
|
- script: |
|
|
|
|
. venv/bin/activate
|
|
|
|
pip install -e .
|
|
|
|
displayName: 'Install Home Assistant'
|
2019-07-31 01:44:39 +02:00
|
|
|
- script: |
|
2019-09-16 10:34:31 +02:00
|
|
|
set -e
|
|
|
|
|
2019-06-28 19:35:17 +02:00
|
|
|
. venv/bin/activate
|
2019-11-05 21:12:29 +01:00
|
|
|
pytest --timeout=9 --durations=10 -n auto --dist=loadfile -qq -o console_output_style=count -p no:sugar tests
|
2019-08-21 18:50:26 +02:00
|
|
|
script/check_dirty
|
2019-07-12 12:08:53 +02:00
|
|
|
displayName: 'Run pytest for python $(python.container)'
|
2019-07-12 11:27:31 +02:00
|
|
|
condition: and(succeeded(), ne(variables['python.container'], variables['PythonMain']))
|
|
|
|
- script: |
|
2019-07-26 16:10:22 +02:00
|
|
|
set -e
|
|
|
|
|
2019-07-12 11:27:31 +02:00
|
|
|
. venv/bin/activate
|
2019-11-05 21:58:35 +01:00
|
|
|
pytest --timeout=9 --durations=10 -n auto --dist=loadfile --cov homeassistant --cov-report html -qq -o console_output_style=count -p no:sugar tests
|
2019-07-28 12:39:06 +02:00
|
|
|
codecov --token $(codecovToken)
|
2019-08-21 18:50:26 +02:00
|
|
|
script/check_dirty
|
2019-07-12 12:08:53 +02:00
|
|
|
displayName: 'Run pytest for python $(python.container) / coverage'
|
2019-07-12 11:27:31 +02:00
|
|
|
condition: and(succeeded(), eq(variables['python.container'], variables['PythonMain']))
|
2019-06-28 19:35:17 +02:00
|
|
|
|
|
|
|
- stage: 'FullCheck'
|
2019-06-09 15:32:30 +02:00
|
|
|
dependsOn:
|
2019-06-28 19:35:17 +02:00
|
|
|
- 'Overview'
|
|
|
|
jobs:
|
2019-07-16 17:47:07 +02:00
|
|
|
- job: 'Pylint'
|
2019-06-28 19:35:17 +02:00
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
container: $[ variables['PythonMain'] ]
|
|
|
|
steps:
|
2019-08-04 14:32:35 +02:00
|
|
|
- template: templates/azp-step-cache.yaml@azure
|
|
|
|
parameters:
|
2019-10-16 17:11:25 +02:00
|
|
|
keyfile: 'requirements_all.txt | requirements_test.txt | homeassistant/package_constraints.txt'
|
2019-08-04 14:32:35 +02:00
|
|
|
build: |
|
|
|
|
set -e
|
|
|
|
python -m venv venv
|
2019-07-31 01:44:39 +02:00
|
|
|
|
2019-08-04 14:32:35 +02:00
|
|
|
. venv/bin/activate
|
2019-11-24 14:35:30 +01:00
|
|
|
pip install -U pip setuptools wheel
|
2019-08-04 14:32:35 +02:00
|
|
|
pip install -r requirements_all.txt -c homeassistant/package_constraints.txt
|
|
|
|
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
|
2019-10-16 17:11:25 +02:00
|
|
|
- script: |
|
|
|
|
. venv/bin/activate
|
|
|
|
pip install -e .
|
|
|
|
displayName: 'Install Home Assistant'
|
2019-06-28 19:35:17 +02:00
|
|
|
- script: |
|
|
|
|
. venv/bin/activate
|
2019-10-23 22:18:41 +02:00
|
|
|
pylint homeassistant
|
2019-06-28 19:35:17 +02:00
|
|
|
displayName: 'Run pylint'
|
2019-06-28 22:31:27 +02:00
|
|
|
- job: 'Mypy'
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
container: $[ variables['PythonMain'] ]
|
|
|
|
steps:
|
2019-10-16 17:37:24 +02:00
|
|
|
- template: templates/azp-step-cache.yaml@azure
|
|
|
|
parameters:
|
2019-10-18 02:12:58 +02:00
|
|
|
keyfile: 'requirements_test.txt | setup.py | homeassistant/package_constraints.txt'
|
2019-10-16 17:37:24 +02:00
|
|
|
build: |
|
|
|
|
python -m venv venv
|
2019-06-28 22:31:27 +02:00
|
|
|
|
2019-10-16 17:37:24 +02:00
|
|
|
. venv/bin/activate
|
2019-10-18 02:12:58 +02:00
|
|
|
pip install -e . -r requirements_test.txt -c homeassistant/package_constraints.txt
|
2019-11-02 20:21:09 +01:00
|
|
|
pre-commit install-hooks --config .pre-commit-config-all.yaml
|
2019-06-28 22:31:27 +02:00
|
|
|
- script: |
|
|
|
|
. venv/bin/activate
|
2019-11-02 20:21:09 +01:00
|
|
|
pre-commit run --config .pre-commit-config-all.yaml mypy --all-files
|
2019-07-31 01:44:39 +02:00
|
|
|
displayName: 'Run mypy'
|