diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index c1cc04836a94..0a372591614f 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -1,12 +1,6 @@ parameters: - name: platform type: string - values: - - broadcom - - centec-arm64 - - marvell-armhf - - mellanox - - vs - name: platform_arch type: string @@ -18,12 +12,6 @@ parameters: - name: platform_short type: string - values: - - brcm - - centec-arm64 - - marvell-armhf - - mlnx - - vs - name: cache_mode type: string @@ -34,9 +22,6 @@ parameters: - name: pool type: string - values: - - sonicbld - - sonicbld_8c default: sonicbld - name: dbg_image @@ -59,10 +44,17 @@ parameters: type: number default: 600 +- name: job_name + type: string + default: '' + jobs: - job: pool: ${{ parameters.pool }} - displayName: ${{ parameters.platform }} + ${{ if ne(parameters.job_name, '') }}: + displayName: ${{ parameters.job_name }} + ${{ if eq(parameters.job_name, '') }}: + displayName: ${{ parameters.platform }} timeoutInMinutes: ${{ parameters.timeout }} steps: - template: cleanup.yml diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml index 8524027d7b11..c60242e91fa4 100644 --- a/.azure-pipelines/official-build.yml +++ b/.azure-pipelines/official-build.yml @@ -8,8 +8,7 @@ schedules: displayName: Daily midnight build branches: include: - - master - always: true + - disable trigger: none pr: none @@ -18,31 +17,6 @@ stages: - stage: Build jobs: - - template: build-template.yml - parameters: - platform: broadcom - platform_short: brcm - cache_mode: wcache - dbg_image: true - swi_image: true - raw_image: true - sync_rpc_image: true - - - template: build-template.yml - parameters: - platform: mellanox - platform_short: mlnx - cache_mode: wcache - dbg_image: true - sync_rpc_image: true - - - template: build-template.yml - parameters: - platform: vs - platform_short: vs - dbg_image: true - cache_mode: wcache - - template: build-template.yml parameters: timeout: 3600 @@ -50,13 +24,4 @@ stages: platform_arch: armhf platform_short: marvell-armhf cache_mode: wcache - pool: sonicbld_8c - - - template: build-template.yml - parameters: - timeout: 3600 - platform: centec-arm64 - platform_arch: arm64 - platform_short: centec-arm64 - cache_mode: wcache - pool: sonicbld_8c + pool: sonic-arm64-bld-2 diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000000..d92f952628b4 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,2 @@ +automerge: +- all: ['files/build/versions/**'] diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 000000000000..6c664fc66cb3 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,21 @@ +# This workflow will merge pull requests automatically +# + +name: automerge +on: + check_suite: + types: + - completed +jobs: + automerge: + runs-on: ubuntu-latest + if: github.event.check_suite.app.name == 'Azure Pipelines' && github.event.check_suite.conclusion == 'success' + steps: + - name: automerge + uses: 'pascalgn/automerge-action@v0.13.1' + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + MERGE_LABELS: 'automerge' + MERGE_METHOD: 'squash' + MERGE_FILTER_AUTHOR: 'xumia' + MERGE_DELETE_BRANCH: true diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 000000000000..0e2461b5df26 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,26 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler + +name: Labeler +on: + pull_request: + types: + - opened + - reopened + branches: + - '202012' + - 'master' + paths: + - 'files/build/versions/**' + +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@main + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5d36ff5be8ec..f3a38851c141 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,136 +1,27 @@ -# Starter pipeline # Start with a minimal pipeline that you can customize to build and deploy your code. # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml -trigger: +schedules: +- cron: "0 8 * * *" + displayName: Daily midnight build branches: include: - - master - - 202012 - paths: - exclude: - - .github + - master + always: true + +trigger: none +pr: none -pr: - branches: - include: - - master - paths: - exclude: - - .github - -name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) +pool: sonicbld -resources: - repositories: - - repository: sonic-mgmt - type: github - name: Azure/sonic-mgmt - endpoint: build +variables: + TIMEOUTINMINUTES: 1 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 - + - job: job1 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 + - script: | + echo abc diff --git a/files/build/versions-test b/files/build/versions-test new file mode 100644 index 000000000000..2d7087cde0b3 --- /dev/null +++ b/files/build/versions-test @@ -0,0 +1 @@ +test==1.1.3 diff --git a/files/build/versions/test2/versions-py2 b/files/build/versions/test2/versions-py2 new file mode 100644 index 000000000000..cc7bbe72e52d --- /dev/null +++ b/files/build/versions/test2/versions-py2 @@ -0,0 +1 @@ +test==1.1.2 diff --git a/files/build/versions/versions-test b/files/build/versions/versions-test new file mode 100644 index 000000000000..2d7087cde0b3 --- /dev/null +++ b/files/build/versions/versions-test @@ -0,0 +1 @@ +test==1.1.3