-
Notifications
You must be signed in to change notification settings - Fork 113
/
azure-pipelines.yml
94 lines (81 loc) · 2.87 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
branches:
include:
- master
pr:
branches:
include:
- master
stages:
- stage: Build
jobs:
- job:
displayName: "build"
timeoutInMinutes: 60
variables:
DIFF_COVER_CHECK_THRESHOLD: 80
DIFF_COVER_ENABLE: 'true'
pool:
vmImage: ubuntu-20.04
container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-bookworm:latest
steps:
- checkout: self
clean: true
submodules: recursive
displayName: 'Checkout code'
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 142
artifact: sonic-buildimage.vs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
patterns: |
**/*.whl
**/*.deb
displayName: "Download sonic buildimage"
- script: |
set -ex
sudo apt-get -y purge libhiredis-dev libnl-3-dev libnl-route-3-dev
sudo apt-get -y install libhiredis0.14
sudo dpkg -i ../target/debs/bookworm/{libyang_1.0.73_amd64.deb,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}
sudo python3 -m pip install ../target/python-wheels/bookworm/swsssdk*-py3-*.whl
sudo python3 -m pip install ../target/python-wheels/bookworm/sonic_py_common-1.0-py3-none-any.whl
python3 setup.py bdist_wheel
cp dist/*.whl $(Build.ArtifactStagingDirectory)/
displayName: "Build"
- script: |
set -ex
sudo python3 -m pip install dist/asyncsnmp-2.1.0-py3-none-any.whl
python3 setup.py test
displayName: "Unit tests"
- script: |
set -ex
# Install .NET CORE
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/debian/12/prod
sudo apt-get update
sudo apt-get install -y dotnet-sdk-8.0
displayName: "Install .NET CORE"
- 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"