-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add build vs and test pipeline #21318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wangxin
merged 23 commits into
sonic-net:master
from
xwjiang-ms:add_build_vs_and_test_pipeline
Jan 17, 2025
Merged
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3bc5b28
Add quick build and test pipeline
xwjiang-ms ccf212c
Merge branch 'master' into add_build_vs_and_test_pipeline
xwjiang-ms dccfc70
Add quick build and test pipeline
xwjiang-ms 65aab7f
fix
xwjiang-ms b93029e
fix
xwjiang-ms 5729cf4
fix
xwjiang-ms d61414f
fix
xwjiang-ms 63f2456
fix
xwjiang-ms 212928d
fix
xwjiang-ms 10b8493
fix
xwjiang-ms 76d75ca
fix
xwjiang-ms 788c448
for test
xwjiang-ms 2e9fcb8
remove test code
xwjiang-ms 2980f3e
test
xwjiang-ms 52e232b
test
xwjiang-ms e3de1f3
fix error
xwjiang-ms 88b5c6e
test
xwjiang-ms 0aacb96
test
xwjiang-ms a5ebc1c
fix
xwjiang-ms 70fbb42
refine
xwjiang-ms 91b6b10
use 1 KVM worker in default
xwjiang-ms b57eb8e
refine
xwjiang-ms a3205f4
fix comments
xwjiang-ms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| pr: | ||
| branches: | ||
| include: | ||
| - master | ||
| paths: | ||
| exclude: | ||
| - .github | ||
| - docs | ||
| - LICENSE | ||
| - README.md | ||
| - SECURITY.md | ||
| trigger: none | ||
|
|
||
|
|
||
| name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) | ||
|
|
||
| resources: | ||
| repositories: | ||
| - repository: sonic-mgmt | ||
| type: github | ||
| name: sonic-net/sonic-mgmt | ||
| ref: master | ||
| endpoint: sonic-net | ||
| - repository: buildimage | ||
| type: github | ||
| name: sonic-net/sonic-buildimage | ||
| endpoint: sonic-net | ||
| ref: master | ||
|
|
||
|
|
||
| variables: | ||
| - template: .azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage | ||
| - template: .azure-pipelines/template-variables.yml@buildimage | ||
| - name: CACHE_MODE | ||
| value: rcache | ||
| - name: ENABLE_FIPS | ||
| value: y | ||
| - name: BUILD_BRANCH | ||
| ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: | ||
| value: $(System.PullRequest.TargetBranch) | ||
| ${{ else }}: | ||
| value: $(Build.SourceBranchName) | ||
|
|
||
|
|
||
| parameters: | ||
| - name: SUBMODULE | ||
| type: string | ||
| default: ' ' | ||
|
|
||
| - name: COMMIT_ID | ||
| type: string | ||
| default: ' ' | ||
|
|
||
| - name: MGMT_BRANCH | ||
| type: string | ||
| default: 'master' | ||
|
|
||
| - name: TOPOLOGY | ||
| type: string | ||
| default: '' | ||
| values: | ||
| - t0 | ||
| - t0-64-32 | ||
| - t1-lag | ||
| - multi-asic-t1-lag | ||
| - dualtor | ||
| - dpu | ||
|
|
||
| - name: DEPLOY_MG_EXTRA_PARAMS | ||
| type: string | ||
| default: ' ' | ||
|
|
||
| - name: SCRIPTS | ||
| type: string | ||
| default: ' ' | ||
|
|
||
| - name: FEATURES | ||
| type: string | ||
| default: ' ' | ||
|
|
||
| - name: MIN_WORKER | ||
| type: string | ||
| default: '1' | ||
|
|
||
| - name: MAX_WORKER | ||
| type: string | ||
| default: '1' | ||
|
|
||
| - name: STOP_ON_FAILURE | ||
| type: string | ||
| default: 'False' | ||
| values: | ||
| - 'True' | ||
| - 'False' | ||
|
|
||
| stages: | ||
| - stage: BuildVS | ||
| pool: sonicbld-1es | ||
| jobs: | ||
| - template: azure-pipelines-build.yml | ||
| parameters: | ||
| buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) BUILD_MULTIASIC_KVM=y INCLUDE_DHCP_SERVER=y ${{ variables. VERSION_CONTROL_OPTIONS }}' | ||
| jobGroups: | ||
| - name: vs | ||
| SUBMODULE: ${{ parameters.SUBMODULE }} | ||
| COMMIT_ID: ${{ parameters.COMMIT_ID }} | ||
|
|
||
| - stage: Test | ||
| dependsOn: BuildVS | ||
| condition: and(succeeded(), and(ne(stageDependencies.BuildVS.outputs['vs.SetVar.SKIP_VSTEST'], 'YES'), in(dependencies.BuildVS.result, 'Succeeded', 'SucceededWithIssues'))) | ||
| variables: | ||
| - group: SONiC-Elastictest | ||
| - name: inventory | ||
| value: veos_vtb | ||
| - name: testbed_file | ||
| value: vtestbed.yaml | ||
|
|
||
| jobs: | ||
| - job: KVMTEST | ||
| displayName: "kvmtest by Elastictest" | ||
| timeoutInMinutes: 240 | ||
| continueOnError: false | ||
| pool: sonic-ubuntu-1c | ||
| steps: | ||
| - template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt | ||
| parameters: | ||
| TOPOLOGY: ${{ parameters.TOPOLOGY }} | ||
| MIN_WORKER: ${{ parameters.MIN_WORKER }} | ||
| MAX_WORKER: ${{ parameters.MAX_WORKER }} | ||
| KVM_IMAGE_BRANCH: $(BUILD_BRANCH) | ||
| MGMT_BRANCH: ${{ parameters.MGMT_BRANCH }} | ||
| SCRIPTS: ${{ parameters.SCRIPTS }} | ||
| FEATURES: ${{ parameters.FEATURES }} | ||
| DEPLOY_MG_EXTRA_PARAMS: ${{ parameters.DEPLOY_MG_EXTRA_PARAMS }} | ||
| STOP_ON_FAILURE: ${{ parameters.STOP_ON_FAILURE }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this pipeline supposed to be executed for each PR or be manually executed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's manually executed, maybe need to set to pr: none