forked from fvutils/pyvsc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
72 lines (60 loc) · 2.02 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
jobs:
- job: PyVSC_Linux
pool:
vmImage: 'ubuntu-18.04'
variables:
- name: build_num
value: $(Build.BuildNumber)
steps:
- script: |
python3 --version
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine
python3 -m pip install -r requirements_dev.txt
displayName: 'Install Python packages'
- script: |
export PYTHONPATH=$(Build.Repository.LocalPath)/src
python3 -m pytest ve/unit --cov=./src --cov-report=xml --cov-report=html --doctest-modules --junitxml=junit/test-results.xml
displayName: 'Run Unit Tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results'
# - script: |
# python scripts/run_pylint.py
# displayName: 'Run PyLint'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- script: |
mkdir coverdata
i=1
for file in `find -name 'coverage.xml'`; do
cp $file coverdata/coverage_${i}.xml
i=`expr $i + 1`
done
displayName: 'Collect coverage data'
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Build.Repository.LocalPath)/coverdata
artifactName: coverdata
displayName: 'Publish coverage data'
- script: |
python3 setup.py bdist_wheel --universal
displayName: 'Build Wheel'
- task: TwineAuthenticate@1
condition: eq(variables['Build.SourceBranchName'], 'master')
inputs:
pythonUploadServiceConnection: pypi-pyvsc
- script: |
# Only deploy from master
if test "$(Build.SourceBranchName)" = "master"; then
python3 -m twine --version
echo "Calling twine"
python3 -m twine upload -r pyvsc --config-file $(PYPIRC_PATH) dist/*.whl
echo "Calling twine complete"
fi
displayName: 'Upload to PyPi'