|
6 | 6 | trigger:
|
7 | 7 | - master
|
8 | 8 |
|
9 |
| -pool: |
10 |
| - vmImage: ubuntu-20.04 |
| 9 | +resources: |
| 10 | + repositories: |
| 11 | + - repository: sonic-swss |
| 12 | + type: github |
| 13 | + name: Azure/sonic-swss |
| 14 | + endpoint: build |
11 | 15 |
|
12 |
| -container: |
13 |
| - image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest |
| 16 | +stages: |
| 17 | +- stage: Build |
14 | 18 |
|
15 |
| -steps: |
16 |
| -- task: DownloadPipelineArtifact@2 |
17 |
| - inputs: |
18 |
| - source: specific |
19 |
| - project: build |
20 |
| - pipeline: 1 |
21 |
| - artifact: sonic-buildimage.vs |
22 |
| - runVersion: 'latestFromBranch' |
23 |
| - runBranch: 'refs/heads/master' |
24 |
| - displayName: "Download artifacts from latest sonic-buildimage build" |
| 19 | + jobs: |
| 20 | + - job: |
| 21 | + displayName: "Python3" |
| 22 | + pool: |
| 23 | + vmImage: ubuntu-20.04 |
25 | 24 |
|
26 |
| -- script: | |
27 |
| - set -xe |
28 |
| - sudo dpkg -i libnl-3-200_*.deb |
29 |
| - sudo dpkg -i libnl-genl-3-200_*.deb |
30 |
| - sudo dpkg -i libnl-route-3-200_*.deb |
31 |
| - sudo dpkg -i libnl-nf-3-200_*.deb |
32 |
| - sudo dpkg -i libhiredis0.14_*.deb |
33 |
| - sudo dpkg -i libswsscommon_1.0.0_amd64.deb |
34 |
| - sudo dpkg -i python3-swsscommon_1.0.0_amd64.deb |
35 |
| - sudo dpkg -i libyang_1.0.73_amd64.deb |
36 |
| - sudo dpkg -i libyang-cpp_1.0.73_amd64.deb |
37 |
| - sudo dpkg -i python3-yang_1.0.73_amd64.deb |
38 |
| - workingDirectory: $(Pipeline.Workspace)/target/debs/buster/ |
39 |
| - displayName: 'Install Debian dependencies' |
| 25 | + container: |
| 26 | + image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest |
40 | 27 |
|
41 |
| -- script: | |
42 |
| - set -xe |
43 |
| - sudo pip3 install swsssdk-2.0.1-py3-none-any.whl |
44 |
| - sudo pip3 install sonic_py_common-1.0-py3-none-any.whl |
45 |
| - sudo pip3 install sonic_config_engine-1.0-py3-none-any.whl |
46 |
| - sudo pip3 install sonic_platform_common-1.0-py3-none-any.whl |
47 |
| - sudo pip3 install sonic_yang_mgmt-1.0-py3-none-any.whl |
48 |
| - sudo pip3 install sonic_yang_models-1.0-py3-none-any.whl |
49 |
| - workingDirectory: $(Pipeline.Workspace)/target/python-wheels/ |
50 |
| - displayName: 'Install Python dependencies' |
| 28 | + steps: |
| 29 | + - task: DownloadPipelineArtifact@2 |
| 30 | + inputs: |
| 31 | + source: specific |
| 32 | + project: build |
| 33 | + pipeline: 1 |
| 34 | + artifact: sonic-buildimage.vs |
| 35 | + runVersion: 'latestFromBranch' |
| 36 | + runBranch: 'refs/heads/master' |
| 37 | + displayName: "Download artifacts from latest sonic-buildimage build" |
51 | 38 |
|
52 |
| -- script: | |
53 |
| - python3 setup.py test |
54 |
| - displayName: 'Test Python 3' |
| 39 | + - script: | |
| 40 | + set -xe |
| 41 | + sudo dpkg -i libnl-3-200_*.deb |
| 42 | + sudo dpkg -i libnl-genl-3-200_*.deb |
| 43 | + sudo dpkg -i libnl-route-3-200_*.deb |
| 44 | + sudo dpkg -i libnl-nf-3-200_*.deb |
| 45 | + sudo dpkg -i libhiredis0.14_*.deb |
| 46 | + sudo dpkg -i libswsscommon_1.0.0_amd64.deb |
| 47 | + sudo dpkg -i python3-swsscommon_1.0.0_amd64.deb |
| 48 | + sudo dpkg -i libyang_1.0.73_amd64.deb |
| 49 | + sudo dpkg -i libyang-cpp_1.0.73_amd64.deb |
| 50 | + sudo dpkg -i python3-yang_1.0.73_amd64.deb |
| 51 | + workingDirectory: $(Pipeline.Workspace)/target/debs/buster/ |
| 52 | + displayName: 'Install Debian dependencies' |
55 | 53 |
|
56 |
| -- task: PublishTestResults@2 |
57 |
| - inputs: |
58 |
| - testResultsFiles: '$(System.DefaultWorkingDirectory)/test-results.xml' |
59 |
| - testRunTitle: Python 3 |
60 |
| - failTaskOnFailedTests: true |
61 |
| - condition: succeededOrFailed() |
62 |
| - displayName: 'Publish Python 3 test results' |
| 54 | + - script: | |
| 55 | + set -xe |
| 56 | + sudo pip3 install swsssdk-2.0.1-py3-none-any.whl |
| 57 | + sudo pip3 install sonic_py_common-1.0-py3-none-any.whl |
| 58 | + sudo pip3 install sonic_config_engine-1.0-py3-none-any.whl |
| 59 | + sudo pip3 install sonic_platform_common-1.0-py3-none-any.whl |
| 60 | + sudo pip3 install sonic_yang_mgmt-1.0-py3-none-any.whl |
| 61 | + sudo pip3 install sonic_yang_models-1.0-py3-none-any.whl |
| 62 | + workingDirectory: $(Pipeline.Workspace)/target/python-wheels/ |
| 63 | + displayName: 'Install Python dependencies' |
63 | 64 |
|
64 |
| -- task: PublishCodeCoverageResults@1 |
65 |
| - inputs: |
66 |
| - codeCoverageTool: Cobertura |
67 |
| - summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml' |
68 |
| - reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov/' |
69 |
| - displayName: 'Publish Python 3 test coverage' |
| 65 | + - script: | |
| 66 | + python3 setup.py test |
| 67 | + displayName: 'Test Python 3' |
70 | 68 |
|
71 |
| -- script: | |
72 |
| - set -e |
73 |
| - python3 setup.py bdist_wheel |
74 |
| - displayName: 'Build Python 3 wheel' |
| 69 | + - task: PublishTestResults@2 |
| 70 | + inputs: |
| 71 | + testResultsFiles: '$(System.DefaultWorkingDirectory)/test-results.xml' |
| 72 | + testRunTitle: Python 3 |
| 73 | + failTaskOnFailedTests: true |
| 74 | + condition: succeededOrFailed() |
| 75 | + displayName: 'Publish Python 3 test results' |
75 | 76 |
|
76 |
| -- publish: '$(System.DefaultWorkingDirectory)/dist/' |
77 |
| - artifact: wheels |
78 |
| - displayName: "Publish Python wheels" |
| 77 | + - task: PublishCodeCoverageResults@1 |
| 78 | + inputs: |
| 79 | + codeCoverageTool: Cobertura |
| 80 | + summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml' |
| 81 | + reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov/' |
| 82 | + displayName: 'Publish Python 3 test coverage' |
| 83 | + |
| 84 | + - script: | |
| 85 | + set -e |
| 86 | + python3 setup.py bdist_wheel |
| 87 | + displayName: 'Build Python 3 wheel' |
| 88 | +
|
| 89 | + - publish: '$(System.DefaultWorkingDirectory)/dist/' |
| 90 | + artifact: wheels |
| 91 | + displayName: "Publish Python wheels" |
| 92 | + |
| 93 | +- stage: BuildDocker |
| 94 | + dependsOn: Build |
| 95 | + condition: succeeded('Build') |
| 96 | + jobs: |
| 97 | + - template: .azure-pipelines/build-docker-sonic-vs-template.yml |
| 98 | + parameters: |
| 99 | + artifact_name: docker-sonic-vs |
| 100 | + |
| 101 | +- stage: Test |
| 102 | + dependsOn: BuildDocker |
| 103 | + condition: succeeded('BuildDocker') |
| 104 | + jobs: |
| 105 | + - template: .azure-pipelines/test-docker-sonic-vs-template.yml |
| 106 | + parameters: |
| 107 | + log_artifact_name: log |
0 commit comments