[ci]: add ci/pr build for 202012 (#7039)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
parent
7499434a10
commit
65ac29627d
12
.artifactignore
Normal file
12
.artifactignore
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
**/*
|
||||||
|
!target/*.bin
|
||||||
|
!target/*.log
|
||||||
|
!target/*.img.gz
|
||||||
|
!target/docker-sonic-vs.gz
|
||||||
|
!target/docker-ptf.gz
|
||||||
|
!target/debs/**/*.deb
|
||||||
|
!target/debs/**/*.deb.log
|
||||||
|
!target/debs/**/*.deb-install.log
|
||||||
|
!target/python-wheels/*.whl
|
||||||
|
!target/python-wheels/*.whl.log
|
||||||
|
!target/python-wheels/*.whl-install.log
|
@ -4,16 +4,134 @@
|
|||||||
# https://aka.ms/yaml
|
# https://aka.ms/yaml
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
- main
|
branches:
|
||||||
|
include:
|
||||||
|
- master
|
||||||
|
- 202012
|
||||||
|
paths:
|
||||||
|
exclude:
|
||||||
|
- .github
|
||||||
|
|
||||||
pool:
|
pr:
|
||||||
vmImage: 'ubuntu-latest'
|
branches:
|
||||||
|
include:
|
||||||
|
- master
|
||||||
|
- 202012
|
||||||
|
paths:
|
||||||
|
exclude:
|
||||||
|
- .github
|
||||||
|
|
||||||
steps:
|
name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
|
||||||
- script: echo Hello, world!
|
|
||||||
displayName: 'Run a one-line script'
|
|
||||||
|
|
||||||
- script: |
|
resources:
|
||||||
echo Add other tasks to build, test, and deploy your project.
|
repositories:
|
||||||
echo See https://aka.ms/yaml
|
- repository: sonic-mgmt
|
||||||
displayName: 'Run a multi-line script'
|
type: github
|
||||||
|
name: Azure/sonic-mgmt
|
||||||
|
endpoint: build
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- stage: Build
|
||||||
|
pool: sonicbld
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- template: .azure-pipelines/build-template.yml
|
||||||
|
parameters:
|
||||||
|
platform: broadcom
|
||||||
|
platform_short: brcm
|
||||||
|
cache_mode: rcache
|
||||||
|
sync_rpc_image: true
|
||||||
|
|
||||||
|
- template: .azure-pipelines/build-template.yml
|
||||||
|
parameters:
|
||||||
|
platform: mellanox
|
||||||
|
platform_short: mlnx
|
||||||
|
cache_mode: rcache
|
||||||
|
sync_rpc_image: true
|
||||||
|
|
||||||
|
- template: .azure-pipelines/build-template.yml
|
||||||
|
parameters:
|
||||||
|
platform: vs
|
||||||
|
platform_short: vs
|
||||||
|
cache_mode: rcache
|
||||||
|
|
||||||
|
- stage: Test
|
||||||
|
variables:
|
||||||
|
- name: inventory
|
||||||
|
value: veos_vtb
|
||||||
|
- name: testbed_file
|
||||||
|
value: vtestbed.csv
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job:
|
||||||
|
pool: sonictest
|
||||||
|
displayName: "vstest"
|
||||||
|
timeoutInMinutes: 60
|
||||||
|
steps:
|
||||||
|
- checkout: self
|
||||||
|
clean: true
|
||||||
|
submodules: recursive
|
||||||
|
displayName: 'Checkout code'
|
||||||
|
|
||||||
|
- task: DownloadPipelineArtifact@2
|
||||||
|
inputs:
|
||||||
|
source: specific
|
||||||
|
project: build
|
||||||
|
pipeline: 9
|
||||||
|
artifacts: sonic-swss-common.amd64.ubuntu20_04
|
||||||
|
runVersion: 'latestFromBranch'
|
||||||
|
runBranch: 'refs/heads/master'
|
||||||
|
displayName: "Download sonic swss common deb packages"
|
||||||
|
|
||||||
|
- task: DownloadPipelineArtifact@2
|
||||||
|
inputs:
|
||||||
|
artifact: sonic-buildimage.vs
|
||||||
|
displayName: "Download sonic-buildimage.vs artifact"
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -x
|
||||||
|
sudo dpkg -i --force-confask,confnew ../sonic-swss-common.amd64.ubuntu20_04/libswsscommon_1.0.0_amd64.deb
|
||||||
|
sudo dpkg -i ../sonic-swss-common.amd64.ubuntu20_04/python3-swsscommon_1.0.0_amd64.deb
|
||||||
|
sudo docker load -i ../target/docker-sonic-vs.gz
|
||||||
|
docker tag docker-sonic-vs:latest docker-sonic-vs:$(Build.BuildNumber)
|
||||||
|
username=$(id -un)
|
||||||
|
|
||||||
|
trap "docker ps; docker images; ip netns list; \
|
||||||
|
docker rmi docker-sonic-vs:$(Build.BuildNumber); \
|
||||||
|
ip netns list | grep -E [-]srv[0-9]+ | awk '{print $1}' | xargs -I {} sudo ip netns delete {}; \
|
||||||
|
sudo chown -R ${username}.${username} .; \
|
||||||
|
sudo chown -R ${username}.${username} $(System.DefaultWorkingDirectory)" EXIT
|
||||||
|
pushd platform/vs/tests
|
||||||
|
sudo py.test -v --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.BuildNumber)
|
||||||
|
displayName: "Run vs tests"
|
||||||
|
|
||||||
|
- task: PublishTestResults@2
|
||||||
|
inputs:
|
||||||
|
testResultsFiles: '**/tr.xml'
|
||||||
|
testRunTitle: vstest
|
||||||
|
|
||||||
|
- job:
|
||||||
|
pool: sonictest
|
||||||
|
displayName: "kvmtest-t0"
|
||||||
|
timeoutInMinutes: 240
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- template: .azure-pipelines/run-test-template.yml
|
||||||
|
parameters:
|
||||||
|
dut: vlab-01
|
||||||
|
tbname: vms-kvm-t0
|
||||||
|
ptf_name: ptf_vms6-1
|
||||||
|
tbtype: t0
|
||||||
|
|
||||||
|
- job:
|
||||||
|
pool: sonictest-t1-lag
|
||||||
|
displayName: "kvmtest-t1-lag"
|
||||||
|
timeoutInMinutes: 240
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- template: .azure-pipelines/run-test-template.yml
|
||||||
|
parameters:
|
||||||
|
dut: vlab-03
|
||||||
|
tbname: vms-kvm-t1-lag
|
||||||
|
ptf_name: ptf_vms6-2
|
||||||
|
tbtype: t1-lag
|
||||||
|
Reference in New Issue
Block a user