-
Notifications
You must be signed in to change notification settings - Fork 19
/
azure-pipelines.yml
106 lines (90 loc) · 2.31 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# 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:
batch: true
branches:
include:
- rc
- dev
- master
pr:
- rc
- dev
- master
resources:
containers:
- container: py37
image: python:3.7
- container: py38
image: python:3.8
- container: py39
image: python:3.9
stages:
- stage: 'Test'
jobs:
- job: 'Test'
pool:
vmImage: 'ubuntu-latest'
strategy:
maxParallel: 3
matrix:
Python37:
containerResource: py37
Python38:
containerResource: py38
Python39:
containerResource: py39
container: $[ variables['containerResource']]
steps:
- script: |
python -m venv venv
. venv/bin/activate
pip install -r requirements.txt
displayName: 'Install dependencies'
- script: |
. venv/bin/activate
pip install -e .
displayName: 'Install'
- script: |
. venv/bin/activate
pip install -r requirements_test.txt
pip install pytest pytest-azurepipelines pytest-cov pytest-xdist
pytest --cov compal --cov-report html -qq -o console_output_style=count -p no:sugar tests
displayName: 'pytest'
# Dirty but low-effort way to run the same steps that tox does:
# This could be a lint and a test stage
- script: |
. venv/bin/activate
pip install tox
tox
- stage: 'Dist'
dependsOn: 'Test'
jobs:
- job: 'BuildDist'
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python39:
containerResource: py39
container: $[ variables['containerResource']]
steps:
- script: |
python -m venv venv
. venv/bin/activate
pip install -r requirements.txt
pip install readme_renderer twine check-manifest
displayName: 'Install dependencies'
- script: |
. venv/bin/activate
twine check dist/*
check-manifest
- script: |
. venv/bin/activate
python setup.py sdist
displayName: 'Build dist'
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'dist'