mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Update azure-pipelines-ci.yml for Azure Pipelines
This commit is contained in:
parent
cc595632bd
commit
3db106c562
@ -4,8 +4,13 @@ trigger:
|
|||||||
batch: true
|
batch: true
|
||||||
branches:
|
branches:
|
||||||
include:
|
include:
|
||||||
|
- rc
|
||||||
- dev
|
- dev
|
||||||
pr: none
|
- master
|
||||||
|
pr:
|
||||||
|
- rc
|
||||||
|
- dev
|
||||||
|
- master
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
containers:
|
containers:
|
||||||
@ -20,6 +25,7 @@ variables:
|
|||||||
value: '2df3ae11-3bf6-49bc-a809-ba0d340d6a6d'
|
value: '2df3ae11-3bf6-49bc-a809-ba0d340d6a6d'
|
||||||
- name: PythonMain
|
- name: PythonMain
|
||||||
value: '35'
|
value: '35'
|
||||||
|
- group: codecov
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
|
||||||
@ -80,7 +86,7 @@ stages:
|
|||||||
steps:
|
steps:
|
||||||
- script: |
|
- script: |
|
||||||
python --version > .cache
|
python --version > .cache
|
||||||
displayName: 'Set python $(python.version) for requirement cache'
|
displayName: 'Set python $(python.container) for requirement cache'
|
||||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||||
displayName: 'Restore artifacts based on Requirements'
|
displayName: 'Restore artifacts based on Requirements'
|
||||||
inputs:
|
inputs:
|
||||||
@ -97,38 +103,55 @@ stages:
|
|||||||
pip install pytest-azurepipelines -c homeassistant/package_constraints.txt
|
pip install pytest-azurepipelines -c homeassistant/package_constraints.txt
|
||||||
displayName: 'Create Virtual Environment & Install Requirements'
|
displayName: 'Create Virtual Environment & Install Requirements'
|
||||||
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
||||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
# Explicit Cache Save (instead of using RestoreAndSaveCache)
|
||||||
displayName: 'Save artifacts based on Requirements'
|
# Dont wait with cache save for all the other task in this job to complete (±30 minutes), other parallel jobs might utilize this
|
||||||
inputs:
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||||
keyfile: 'requirements_test_all.txt, .cache'
|
displayName: 'Save artifacts based on Requirements'
|
||||||
targetfolder: './venv'
|
inputs:
|
||||||
|
keyfile: 'requirements_test_all.txt, .cache'
|
||||||
|
targetfolder: './venv'
|
||||||
vstsFeed: '$(ArtifactFeed)'
|
vstsFeed: '$(ArtifactFeed)'
|
||||||
- script: |
|
- script: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pip install -e .
|
pip install -e .
|
||||||
displayName: 'Install Home Assistant for python $(python.version)'
|
displayName: 'Install Home Assistant for python $(python.container)'
|
||||||
- script: |
|
- script: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pytest --timeout=9 --durations=10 --junitxml=junit/test-results.xml -qq -o console_output_style=count -p no:sugar tests
|
pytest --timeout=9 --durations=10 --junitxml=test-results.xml -qq -o console_output_style=count -p no:sugar tests
|
||||||
displayName: 'Run pytest for python $(python.version)'
|
displayName: 'Run pytest for python $(python.container)'
|
||||||
|
condition: and(succeeded(), ne(variables['python.container'], variables['PythonMain']))
|
||||||
|
- script: |
|
||||||
|
. venv/bin/activate
|
||||||
|
pytest --timeout=9 --durations=10 --junitxml=test-results.xml --cov --cov-report=xml -qq -o console_output_style=count -p no:sugar tests
|
||||||
|
codecov
|
||||||
|
displayName: 'Run pytest for python $(python.container) / coverage'
|
||||||
|
env:
|
||||||
|
CODECOV_TOKEN: '$(codecovToken)'
|
||||||
|
condition: and(succeeded(), eq(variables['python.container'], variables['PythonMain']))
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
inputs:
|
inputs:
|
||||||
testResultsFiles: '**/test-*.xml'
|
testResultsFiles: 'test-results.xml'
|
||||||
testRunTitle: 'Publish test results for Python $(python.version)'
|
testRunTitle: 'Publish test results for Python $(python.container)'
|
||||||
|
- task: PublishCodeCoverageResults@1
|
||||||
|
inputs:
|
||||||
|
codeCoverageTool: cobertura
|
||||||
|
summaryFileLocation: coverage.xml
|
||||||
|
displayName: 'publish coverage artifact'
|
||||||
|
condition: and(succeeded(), eq(variables['python.container'], variables['PythonMain']))
|
||||||
|
|
||||||
- stage: 'FullCheck'
|
- stage: 'FullCheck'
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- 'Overview'
|
- 'Overview'
|
||||||
jobs:
|
jobs:
|
||||||
- job: 'Pytlint'
|
- job: 'Pylint'
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
container: $[ variables['PythonMain'] ]
|
container: $[ variables['PythonMain'] ]
|
||||||
steps:
|
steps:
|
||||||
- script: |
|
- script: |
|
||||||
python --version > .cache
|
python --version > .cache
|
||||||
displayName: 'Set python $(python.version) for requirement cache'
|
displayName: 'Set python $(PythonMain) for requirement cache'
|
||||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||||
displayName: 'Restore artifacts based on Requirements'
|
displayName: 'Restore artifacts based on Requirements'
|
||||||
inputs:
|
inputs:
|
||||||
@ -154,7 +177,7 @@ stages:
|
|||||||
- script: |
|
- script: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pip install -e .
|
pip install -e .
|
||||||
displayName: 'Install Home Assistant for python $(python.version)'
|
displayName: 'Install Home Assistant for python $(PythonMain)'
|
||||||
- script: |
|
- script: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pylint homeassistant
|
pylint homeassistant
|
||||||
|
Loading…
x
Reference in New Issue
Block a user