-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathazure-pipelines.yml
104 lines (99 loc) · 2.8 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
trigger:
branches:
include: ['develop']
tags:
include: ['*']
pr:
branches:
include: ['*']
jobs:
- job: generate_matrix
displayName: Generate Matrix
pool:
vmImage: 'ubuntu-latest'
steps:
- bash: |
python src/romp/_matrix.py
name: generate_matrix
- job: dist
displayName: Build Wheel and sdist
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.7
architecture: x64
- bash: |
python -m pip install wheel
python setup.py sdist
python setup.py bdist_wheel
displayName: Build Wheel
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(System.DefaultWorkingDirectory)/dist/'
artifactName: dist
- job: test
displayName: Test
dependsOn:
- generate_matrix
- dist
pool:
vmImage: $[ variables.vmImage ]
strategy:
maxParallel: 4
matrix: $[ dependencies.generate_matrix.outputs['generate_matrix.JobsToRun'] ]
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(versionSpec)
architecture: $(architecture)
- task: DownloadBuildArtifacts@0
inputs:
artifactName: 'dist'
downloadPath: $(System.DefaultWorkingDirectory)
- bash: |
python -c 'import sys; print(sys.version); print(sys.platform)'
displayName: Report Python version
- bash: |
python -m pip install tox pytest-azurepipelines
displayName: Install tox
- bash: |
python -m tox -e ${TOXENV} --installpkg dist/*.whl
displayName: tox
env:
ROMP_PERSONAL_ACCESS_TOKEN: $(ROMP_PERSONAL_ACCESS_TOKEN)
ROMP_BUILD_REQUEST_URL: https://dev.azure.com/altendky/romp-on/_apis/build/builds?api-version=5.0
ROMP_USERNAME: $(ROMP_USERNAME)
ROMP_DEFINITION_ID: 5
ROMP_SOURCE_BRANCH: $(Build.SourceBranch)
TOXENV: $[ variables.TOXENV ]
- bash: |
python -m tox -e codecov
displayName: codecov
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- job: publish
displayName: Publish
dependsOn: test
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.7
architecture: x64
- task: DownloadBuildArtifacts@0
inputs:
artifactName: 'dist'
downloadPath: $(System.DefaultWorkingDirectory)
- bash: |
python -m venv venv
venv/bin/pip install twine
displayName: Build venv
- bash: |
venv/bin/python twineontag.py
env:
TWINE_USERNAME: $(TWINE_USERNAME)
TWINE_PASSWORD: $(TWINE_PASSWORD)
displayName: Twine On Tag