|
4 | 4 | # https://aka.ms/yaml |
5 | 5 |
|
6 | 6 | trigger: |
7 | | -- master |
| 7 | + branches: |
| 8 | + include: |
| 9 | + - '*' |
8 | 10 |
|
9 | 11 | pool: |
10 | | - vmImage: ubuntu-20.04 |
| 12 | + vmImage: 'ubuntu-20.04' |
| 13 | + |
| 14 | +container: |
| 15 | + image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest |
11 | 16 |
|
12 | 17 | steps: |
13 | | -- script: echo Hello, world! |
14 | | - displayName: 'Run a one-line script' |
| 18 | +- task: DownloadPipelineArtifact@2 |
| 19 | + inputs: |
| 20 | + source: specific |
| 21 | + project: build |
| 22 | + pipeline: 1 |
| 23 | + artifact: sonic-buildimage.kvm |
| 24 | + runVersion: 'latestFromBranch' |
| 25 | + runBranch: 'refs/heads/master' |
| 26 | + displayName: "Download artifacts from latest sonic-buildimage build" |
| 27 | + |
| 28 | +- script: | |
| 29 | + set -xe |
| 30 | + sudo dpkg -i libnl-3-200_*.deb |
| 31 | + sudo dpkg -i libnl-genl-3-200_*.deb |
| 32 | + sudo dpkg -i libnl-route-3-200_*.deb |
| 33 | + sudo dpkg -i libnl-nf-3-200_*.deb |
| 34 | + sudo dpkg -i libhiredis0.14_*.deb |
| 35 | + sudo dpkg -i libswsscommon_1.0.0_amd64.deb |
| 36 | + sudo dpkg -i python-swsscommon_1.0.0_amd64.deb |
| 37 | + sudo dpkg -i python3-swsscommon_1.0.0_amd64.deb |
| 38 | + workingDirectory: $(Pipeline.Workspace)/target/debs/buster/ |
| 39 | + displayName: 'Install Debian dependencies' |
| 40 | + |
| 41 | +- script: | |
| 42 | + set -xe |
| 43 | + pip2 install swsssdk-2.0.1-py2-none-any.whl |
| 44 | + pip2 install sonic_py_common-1.0-py2-none-any.whl |
| 45 | + pip2 install sonic_config_engine-1.0-py2-none-any.whl |
| 46 | + pip3 install swsssdk-2.0.1-py3-none-any.whl |
| 47 | + pip3 install sonic_py_common-1.0-py3-none-any.whl |
| 48 | + pip3 install sonic_config_engine-1.0-py3-none-any.whl |
| 49 | + workingDirectory: $(Pipeline.Workspace)/target/python-wheels/ |
| 50 | + displayName: 'Install Python dependencies' |
| 51 | + |
| 52 | +# Python 2 |
| 53 | +- script: | |
| 54 | + python2 setup.py test |
| 55 | + displayName: 'Test Python 2' |
| 56 | + |
| 57 | +- task: PublishTestResults@2 |
| 58 | + inputs: |
| 59 | + testResultsFiles: '$(System.DefaultWorkingDirectory)/test-results.xml' |
| 60 | + testRunTitle: Python 2 |
| 61 | + failTaskOnFailedTests: true |
| 62 | + condition: succeededOrFailed() |
| 63 | + displayName: 'Publish Python 2 test results' |
| 64 | + |
| 65 | +- task: PublishCodeCoverageResults@1 |
| 66 | + inputs: |
| 67 | + codeCoverageTool: Cobertura |
| 68 | + summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml' |
| 69 | + reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov/' |
| 70 | + displayName: 'Publish Python 2 test coverage' |
| 71 | + |
| 72 | +- script: | |
| 73 | + set -e |
| 74 | + python2 setup.py bdist_wheel |
| 75 | + displayName: 'Build Python 2 wheel' |
| 76 | + |
| 77 | +# Python 3 |
| 78 | +- script: | |
| 79 | + python3 setup.py test |
| 80 | + displayName: 'Test Python 3' |
| 81 | + |
| 82 | +- task: PublishTestResults@2 |
| 83 | + inputs: |
| 84 | + testResultsFiles: '$(System.DefaultWorkingDirectory)/test-results.xml' |
| 85 | + testRunTitle: Python 3 |
| 86 | + failTaskOnFailedTests: true |
| 87 | + condition: succeededOrFailed() |
| 88 | + displayName: 'Publish Python 3 test results' |
| 89 | + |
| 90 | +- task: PublishCodeCoverageResults@1 |
| 91 | + inputs: |
| 92 | + codeCoverageTool: Cobertura |
| 93 | + summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml' |
| 94 | + reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov/' |
| 95 | + displayName: 'Publish Python 3 test coverage' |
15 | 96 |
|
16 | 97 | - script: | |
17 | | - echo Add other tasks to build, test, and deploy your project. |
18 | | - echo See https://aka.ms/yaml |
19 | | - displayName: 'Run a multi-line script' |
| 98 | + set -e |
| 99 | + python3 setup.py bdist_wheel |
| 100 | + displayName: 'Build Python 3 wheel' |
| 101 | + |
| 102 | +- publish: '$(System.DefaultWorkingDirectory)/dist/' |
| 103 | + artifact: wheels |
| 104 | + displayName: "Publish Python wheels" |
0 commit comments