-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
58 lines (49 loc) · 1.65 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
58 lines (49 loc) · 1.65 KB
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
# 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: none
variables:
CI: 'true'
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_dev.txt
pip install twine
displayName: 'Install dependencies'
- script: |
pip install pytest pytest-azurepipelines==1.0.0rc5
pytest --cov=py_muvr tests/ --cov-report html --nunitxml test-output.xml -m 'not slow'
displayName: 'Run fast tests'
- script: |
pytest --cov=py_muvr tests/ --cov-report html --nunitxml test-output.xml -m 'slow'
displayName: 'Run slow tests'
condition: and(succeeded(), eq(variables['System.PullRequest.TargetBranch'], 'main'))
- script: |
make docs
displayName: 'Build documentation'
# TODO: these next two are to push to RTD and pypi but the logic is a WIP
- script: |
commitHash=${sourceVersion:0:7}
hasTag="$(git tag --contains $commitHash)"
echo "##vso[task.setvariable variable=hasTag]$hasTag"
echo $hasTag
env: {sourceVersion: $(Build.SourceVersion)}
displayName: Look for tag on commit
- script: |
echo ${{ variables.hasTag }}
condition: not(eq(variables.hasTag, ''))
displayName: 'Push to pypi.'