3
3
# Add steps that build, run tests, deploy, and more:
4
4
# https://aka.ms/yaml
5
5
6
- pool : sonicbld
7
-
8
6
trigger :
9
7
branches :
10
8
include :
@@ -21,19 +19,43 @@ stages:
21
19
- job :
22
20
displayName : " build"
23
21
timeoutInMinutes : 60
22
+ pool :
23
+ vmImage : ubuntu-20.04
24
+
25
+ container :
26
+ image : sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest
27
+
24
28
steps :
25
29
- checkout : self
26
30
clean : true
27
31
submodules : recursive
28
32
displayName : ' Checkout code'
29
33
- script : |
30
- echo Hello
31
- # the following is copied from jenkins
32
- # set -ex
33
- # python2 setup.py bdist_wheel
34
- # python3 setup.py bdist_wheel
35
- # mkdir -p target/python-wheels/
36
- # cp dist/swsssdk-2.0.1-{py2,py3}-none-any.whl target/python-wheels/
37
- - publish : $(System.DefaultWorkingDirectory)/target/python-wheels/
34
+ set -ex
35
+
36
+ python3 setup.py bdist_wheel
37
+ mkdir -p $(Build.ArtifactStagingDirectory)/target/python-wheels
38
+ cp dist/*.whl $(Build.ArtifactStagingDirectory)/target/python-wheels/
39
+ displayName: "Build"
40
+ - script : |
41
+ set -ex
42
+
43
+ sudo python3 -m pip install dist/swsssdk-2.0.1-py3-none-any.whl
44
+ python3 setup.py test
45
+ displayName: "Unit tests"
46
+ - publish : $(Build.ArtifactStagingDirectory)
38
47
artifact : sonic-py-swsssdk
39
48
displayName : " Archive artifacts"
49
+ - task : PublishTestResults@2
50
+ inputs :
51
+ testResultsFiles : ' $(System.DefaultWorkingDirectory)/test-results.xml'
52
+ testRunTitle : Python 3
53
+ failTaskOnFailedTests : true
54
+ condition : succeededOrFailed()
55
+ displayName : ' Publish Python 3 test results'
56
+ - task : PublishCodeCoverageResults@1
57
+ inputs :
58
+ codeCoverageTool : Cobertura
59
+ summaryFileLocation : ' $(System.DefaultWorkingDirectory)/coverage.xml'
60
+ reportDirectory : ' $(System.DefaultWorkingDirectory)/htmlcov/'
61
+ displayName : ' Publish Python 3 test coverage'
0 commit comments