Skip to content

Commit

Permalink
[ci]: setup proper azp
Browse files Browse the repository at this point in the history
Signed-off-by: Guohan Lu <[email protected]>
  • Loading branch information
lguohan authored and qiluo-msft committed Apr 5, 2021
1 parent 22ae215 commit 4e063e4
Showing 1 changed file with 50 additions and 10 deletions.
60 changes: 50 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

pool:
vmImage: sonicbld

trigger:
branches:
include:
Expand All @@ -22,18 +19,61 @@ stages:
- job:
displayName: "build"
timeoutInMinutes: 60

pool:
vmImage: ubuntu-20.04

container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest

steps:
- checkout: self
clean: true
submodules: recursive
displayName: 'Checkout code'

- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 1
artifact: sonic-buildimage.vs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic buildimage"

- script: |
set -ex
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}
sudo python3 -m pip install ../target/python-wheels/swsssdk*-py3-*.whl
sudo python3 -m pip install ../target/python-wheels/sonic_py_common-1.0-py3-none-any.whl
python3 setup.py bdist_wheel
cp dist/*.whl $(Build.ArtifactStagingDirectory)/
displayName: "Build"
- script: |
echo Hello
# the following is copied from jenkins
# set -ex
# ./scripts/common/python-asyncsnmp-build/build.sh
# ./scripts/common/python-asyncsnmp-build/test.sh
- publish: $(System.DefaultWorkingDirectory)/target/python-wheels/
set -ex
sudo python3 -m pip install dist/asyncsnmp-2.1.0-py3-none-any.whl
python3 setup.py test
displayName: "Unit tests"
- task: PublishTestResults@2
inputs:
testResultsFiles: '$(System.DefaultWorkingDirectory)/test-results.xml'
testRunTitle: Python 3
failTaskOnFailedTests: true
condition: succeededOrFailed()
displayName: 'Publish Python 3 test results'

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov/'
displayName: 'Publish Python 3 test coverage'

- publish: $(Build.ArtifactStagingDirectory)/
artifact: sonic-snmpagent
displayName: "Archive artifacts"

0 comments on commit 4e063e4

Please sign in to comment.