Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
xwjiang-ms committed Jan 3, 2025
1 parent 2e9fcb8 commit 2980f3e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .azure-pipelines/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,21 @@ parameters:
- name: 'qemuOrCrossBuild'
type: boolean
default: false
- name: SUBMODULE_NAME
type: string
default: ''
- name: COMMIT_ID
type: string
default: ''

jobs:
- template: azure-pipelines-image-template.yml
parameters:
jobFilters: ${{ parameters.jobFilters }}
preSteps: ${{ parameters.preSteps }}
postSteps: ${{ parameters.postSteps }}
SUBMODULE_NAME: ${{ parameters.SUBMODULE_NAME }}
COMMIT_ID: ${{ parameters.COMMIT_ID }}
jobVariables:
PLATFORM_AZP: $(GROUP_NAME)
PLATFORM_ARCH: amd64
Expand Down
16 changes: 14 additions & 2 deletions .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ parameters:
- name: jobVariables
type: object
default: []
- name: SUBMODULE_NAME
type: string
default: ''
- name: COMMIT_ID
type: string
default: ''
jobs:
- template: azure-pipelines-job-groups.yml
parameters:
Expand Down Expand Up @@ -48,8 +54,14 @@ jobs:
displayName: 'setfacl'
- script: |
BRANCH_NAME=$(Build.SourceBranchName)
[ -n "$SYSTEM_PULLREQUEST_PULLREQUESTID" ] && BRANCH_NAME="$SYSTEM_PULLREQUEST_TARGETBRANCH-$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"
git checkout -b $BRANCH_NAME
if [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTID" ]; then
BRANCH_NAME="$SYSTEM_PULLREQUEST_TARGETBRANCH-$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"
git checkout -b $BRANCH_NAME
elif [ -n "${{ parameters.COMMIT_ID }}" and -n "${{ parameters.SUBMODULE_NAME }}"]; then
git submodule update --init --recursive
cd src/${{ parameters.SUBMODULE_NAME }}
git checkout ${{ parameters.COMMIT_ID }}
fi
sudo modprobe overlay
sudo apt-get install -y acl
sudo bash -c "echo 1 > /proc/sys/vm/compact_memory"
Expand Down
10 changes: 6 additions & 4 deletions .azure-pipelines/azure-pipelines-quick-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,18 @@ stages:
- stage: BuildVS
pool: sonicbld-1es
jobs:
- template: azure-pipelines-checkout-submodule-commit.yml
parameters:
SUBMODULE_NAME: ${{ parameters.SUBMODULE_NAME }}
COMMIT_ID: ${{ parameters.COMMIT_ID }}
# - template: azure-pipelines-checkout-submodule-commit.yml
# parameters:
# SUBMODULE_NAME: ${{ parameters.SUBMODULE_NAME }}
# COMMIT_ID: ${{ parameters.COMMIT_ID }}

- 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_NAME: ${{ parameters.SUBMODULE_NAME }}
COMMIT_ID: ${{ parameters.COMMIT_ID }}

- stage: Test
dependsOn: BuildVS
Expand Down

0 comments on commit 2980f3e

Please sign in to comment.