Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
azure-pipelines-ci.yml 6.00 KiB
# https://dev.azure.com/home-assistant

trigger:
  batch: true
  branches:
    include:
    - rc
    - dev
    - master
pr:
  - rc
  - dev
  - master

resources:
  containers:
  - container: 37
    image: homeassistant/ci-azure:3.7
  repositories:
    - repository: azure
      type: github
      name: 'home-assistant/ci-azure'
      endpoint: 'home-assistant'
variables:
  - name: PythonMain
    value: '37'
  - group: codecov

stages:

- stage: 'Overview'
  jobs:
  - job: 'Lint'
    pool:
      vmImage: 'ubuntu-latest'
    container: $[ variables['PythonMain'] ]
    steps:
    - template: templates/azp-step-cache.yaml@azure
      parameters:
        keyfile: 'requirements_test.txt | homeassistant/package_constraints.txt'
        build: |
          python -m venv venv

          . venv/bin/activate
          pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
          pre-commit install-hooks --config .pre-commit-config-all.yaml
    - script: |
        . venv/bin/activate
        pre-commit run flake8 --all-files
      displayName: 'Run flake8'
    - script: |
        . venv/bin/activate
        pre-commit run bandit --all-files
      displayName: 'Run bandit'
    - script: |
        . venv/bin/activate
        pre-commit run isort --all-files --show-diff-on-failure
      displayName: 'Run isort'
    - script: |
        . venv/bin/activate
        pre-commit run check-json --all-files
      displayName: 'Run check-json'
  - job: 'Validate'
    pool:
      vmImage: 'ubuntu-latest'
    container: $[ variables['PythonMain'] ]
    steps:
    - template: templates/azp-step-cache.yaml@azure
      parameters:
        keyfile: 'homeassistant/package_constraints.txt'