33# Add steps that build, run tests, deploy, and more:
44# https://aka.ms/yaml
55
6- pool :
7- vmImage : sonicbld
8-
96trigger :
107 branches :
118 include :
@@ -22,18 +19,61 @@ stages:
2219 - job :
2320 displayName : " build"
2421 timeoutInMinutes : 60
22+
23+ pool :
24+ vmImage : ubuntu-20.04
25+
26+ container :
27+ image : sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest
28+
2529 steps :
2630 - checkout : self
2731 clean : true
2832 submodules : recursive
2933 displayName : ' Checkout code'
34+
35+ - task : DownloadPipelineArtifact@2
36+ inputs :
37+ source : specific
38+ project : build
39+ pipeline : 1
40+ artifact : sonic-buildimage.vs
41+ runVersion : ' latestFromBranch'
42+ runBranch : ' refs/heads/master'
43+ displayName : " Download sonic buildimage"
44+
45+ - script : |
46+ set -ex
47+
48+ sudo dpkg -i ../target/debs/buster/{libswsscommon_1.0.0_amd64.deb,python3-swsscommon_1.0.0_amd64.deb,libnl-3-200_*.deb,libnl-genl-3-200_*.deb,libnl-nf-3-200_*.deb,libnl-route-3-200_*.deb,libhiredis0.14_*.deb}
49+ sudo python3 -m pip install ../target/python-wheels/swsssdk*-py3-*.whl
50+ sudo python3 -m pip install ../target/python-wheels/sonic_py_common-1.0-py3-none-any.whl
51+ python3 setup.py bdist_wheel
52+ cp dist/*.whl $(Build.ArtifactStagingDirectory)/
53+ displayName: "Build"
54+
3055 - script : |
31- echo Hello
32- # the following is copied from jenkins
33- # set -ex
34- # ./scripts/common/python-asyncsnmp-build/build.sh
35- # ./scripts/common/python-asyncsnmp-build/test.sh
36- - publish : $(System.DefaultWorkingDirectory)/target/python-wheels/
56+ set -ex
57+
58+ sudo python3 -m pip install dist/asyncsnmp-2.1.0-py3-none-any.whl
59+ python3 setup.py test
60+ displayName: "Unit tests"
61+
62+ - task : PublishTestResults@2
63+ inputs :
64+ testResultsFiles : ' $(System.DefaultWorkingDirectory)/test-results.xml'
65+ testRunTitle : Python 3
66+ failTaskOnFailedTests : true
67+ condition : succeededOrFailed()
68+ displayName : ' Publish Python 3 test results'
69+
70+ - task : PublishCodeCoverageResults@1
71+ inputs :
72+ codeCoverageTool : Cobertura
73+ summaryFileLocation : ' $(System.DefaultWorkingDirectory)/coverage.xml'
74+ reportDirectory : ' $(System.DefaultWorkingDirectory)/htmlcov/'
75+ displayName : ' Publish Python 3 test coverage'
76+
77+ - publish : $(Build.ArtifactStagingDirectory)/
3778 artifact : sonic-snmpagent
3879 displayName : " Archive artifacts"
39-
0 commit comments