This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
azure-pipelines-release.yml
98 lines (79 loc) · 2.84 KB
/
azure-pipelines-release.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
workspace:
clean: all
trigger: none # will disable CI builds entirely
steps:
- checkout: self
clean: true
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7.x'
architecture: 'x64'
- script: python -m pip install --upgrade pip
displayName: 'Install/Upgrade pip'
- script: pip uninstall -y mu_environment
displayName: 'Remove existing version of self'
- script: pip install --upgrade -r requirements.txt
displayName: 'Install requirements'
- script: pip install -e .
displayName: 'Install from Source'
- script: pytest -v --junitxml=test.junit.xml --html=pytest_MuEnvironment_report.html --self-contained-html --cov=MuEnvironment --cov-report html:cov_html --cov-report xml:cov.xml --cov-config .coveragerc
displayName: 'Run UnitTests'
# Publish Test Results to Azure Pipelines/TFS
- task: PublishTestResults@2
displayName: 'Publish junit test results'
continueOnError: true
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit' # Options: JUnit, NUnit, VSTest, xUnit
testResultsFiles: 'test.junit.xml'
mergeTestResults: true # Optional
publishRunAttachments: true # Optional
# Publish Build Artifacts
# Publish build artifacts to Azure Pipelines/TFS or a file share
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'pytest_MuEnvironment_report.html'
artifactName: 'MuEnvironment unit test report'
continueOnError: true
condition: succeededOrFailed()
# Publish Code Coverage Results
# Publish Cobertura code coverage results
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'cobertura' # Options: cobertura, jaCoCo
summaryFileLocation: $(System.DefaultWorkingDirectory)/cov.xml
reportDirectory: $(System.DefaultWorkingDirectory)/cov_html
condition: succeededOrFailed()
- script: flake8 .
displayName: 'Run flake8'
condition: succeededOrFailed()
# Only capture and archive the lint log on failures.
- script: flake8 . > flake8.err.log
displayName: 'Capture flake8 failures'
condition: Failed()
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'flake8.err.log'
artifactName: 'Flake8 Error log file'
continueOnError: true
condition: Failed()
- script: pip install --upgrade -r requirements.publisher.txt
displayName: 'Install PyPI publishing requirements'
- script: python setup.py sdist bdist_wheel
displayName: 'Build a wheel'
# Python Script
# Run a Python script.
- task: PythonScript@0
displayName: 'Confirm Version and Tag'
inputs:
scriptSource: 'filePath' # Options: filePath, inline
scriptPath: ConfirmVersionAndTag.py
#arguments: # Optional
#pythonInterpreter: # Optional
#workingDirectory: # Optional
failOnStderr: true # Optional
- task: TwineAuthenticate@0
inputs:
externalFeeds: 'Pypi-MuPip'
- script: 'twine upload -r Pypi-MuPip --config-file $(PYPIRC_PATH) dist/*'
displayName: 'Publish to pypi'