tubone24/ebook_homebrew

View on GitHub
azure-pipelines.yml

Summary

Maintainability
Test Coverage
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

trigger:
- master

jobs:

- job: 'Test'
  pool:
    vmImage: 'Ubuntu-16.04'
  steps:
  - script: echo Ubuntu-16.04
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '$(python.version)'
      architecture: 'x64'
  - script: python -m pip install --upgrade pip && pip install -r requirements.txt && pip install -r requirements-test.txt
    displayName: 'Install dependencies'

  - script: |
      pytest --it --junit-xml=test_results.xml
    displayName: 'pytest'

  - task: PublishTestResults@2
    inputs:
      testResultsFiles: 'test_results.xml'
      testRunTitle: 'Python $(python.version)'
    condition: succeededOrFailed()

  strategy:
    matrix:
      Python36:
        python.version: '3.6'
    maxParallel: 4

- job: macOS
  pool:
    vmImage: 'macOS-10.13'
  steps:
  - script: echo MacOSX
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '$(python.version)'
      architecture: 'x64'
  - script: python -m pip install --upgrade pip && pip install -r requirements.txt && pip install -r requirements-test.txt
    displayName: 'Install dependencies'

  - script: |
      pytest --it --junit-xml=test_results.xml
    displayName: 'pytest'

  - task: PublishTestResults@2
    inputs:
      testResultsFiles: 'test_results.xml'
      testRunTitle: 'Python $(python.version)'
    condition: succeededOrFailed()

  strategy:
    matrix:
      Python36:
        python.version: '3.6'
    maxParallel: 4

- job: 'Publish'
  dependsOn: 'Test'
  pool:
    vmImage: 'Ubuntu-16.04'

  steps:
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '3.x'
      architecture: 'x64'

  - script: python setup.py sdist
    displayName: 'Build sdist'