| 1 |
# Create the project in Azure with: |
| 2 |
# az devops project create --name $name --organization https://dev.azure.com/$org/ --visibility public |
| 3 |
# then configure the pipelines (through web UI) |
| 4 |
|
| 5 |
trigger: |
| 6 |
branches: |
| 7 |
include: |
| 8 |
- '*' |
| 9 |
tags: |
| 10 |
include: |
| 11 |
- '*' |
| 12 |
|
| 13 |
pool: |
| 14 |
vmImage: $(pool_vm_image) |
| 15 |
|
| 16 |
variables: |
| 17 |
- group: Azure secrets |
| 18 |
|
| 19 |
stages: |
| 20 |
- stage: Test |
| 21 |
jobs: |
| 22 |
|
| 23 |
- job: 'Test' |
| 24 |
strategy: |
| 25 |
matrix: |
| 26 |
Bionic Python 3.6: |
| 27 |
python.version: '3.6' |
| 28 |
pool_vm_image: Ubuntu-18.04 |
| 29 |
Bionic Python 3.8: |
| 30 |
python.version: '3.8' |
| 31 |
pool_vm_image: Ubuntu-18.04 |
| 32 |
Windows: |
| 33 |
python.version: '3.8' |
| 34 |
pool_vm_image: vs2017-win2016 |
| 35 |
MacOS: |
| 36 |
python.version: '3.8' |
| 37 |
pool_vm_image: macos-10.15 |
| 38 |
|
| 39 |
maxParallel: 4 |
| 40 |
|
| 41 |
steps: |
| 42 |
- task: UsePythonVersion@0 |
| 43 |
inputs: |
| 44 |
versionSpec: '$(python.version)' |
| 45 |
architecture: 'x64' |
| 46 |
|
| 47 |
- script: python -m pip install tox |
| 48 |
displayName: 'Install tox' |
| 49 |
|
| 50 |
- script: | |
| 51 |
tox -- --junit-xml=test-results.xml |
| 52 |
env: |
| 53 |
TOXENV: {libs,sa12,sa13} |
| 54 |
displayName: 'run tests' |
| 55 |
|
| 56 |
- task: PublishTestResults@2 |
| 57 |
inputs: |
| 58 |
testResultsFiles: '**/test-results.xml' |
| 59 |
testRunTitle: 'Python $(python.version)' |
| 60 |
condition: succeededOrFailed() |
| 61 |
|
| 62 |
- stage: Publish |
| 63 |
dependsOn: Test |
| 64 |
jobs: |
| 65 |
- job: 'Publish' |
| 66 |
|
| 67 |
steps: |
| 68 |
- task: UsePythonVersion@0 |
| 69 |
inputs: |
| 70 |
versionSpec: '3.8' |
| 71 |
architecture: 'x64' |
| 72 |
|
| 73 |
- script: python -m pip install tox |
| 74 |
displayName: 'Install tox' |
| 75 |
|
| 76 |
- script: | |
| 77 |
tox -e release |
| 78 |
env: |
| 79 |
TWINE_PASSWORD: $(PyPI-token) |
| 80 |
displayName: 'publish to PyPI' |
| 81 |
|
| 82 |
condition: contains(variables['Build.SourceBranch'], 'tags') |