mirror of
https://github.com/analogdevicesinc/linux.git
synced 2026-05-30 00:55:04 +08:00
Update azure-pipelines.yml to run builds for release branches following the new naming convention. Release branches now follow the format `xlnx/release/linux-v<kernel_version>-<release>`. Update prepare_artifacts.sh scripts to upload artifacts under `linux-v<kernel_version>-<release>`. Signed-off-by: bia1708 <bianca-maria.popu@analog.com>
262 lines
9.2 KiB
YAML
262 lines
9.2 KiB
YAML
variables:
|
|
- group: Linux_CI
|
|
- name: isMain
|
|
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
|
|
|
|
resources:
|
|
repositories:
|
|
- repository: wiki-scripts
|
|
type: github
|
|
name: analogdevicesinc/wiki-scripts
|
|
endpoint: analogdevicesinc
|
|
|
|
trigger:
|
|
- main
|
|
- next_stable
|
|
- staging/*
|
|
- xlnx/release/*
|
|
|
|
pr:
|
|
- main
|
|
- next_stable
|
|
- xlnx/release/*
|
|
|
|
pool:
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
stages:
|
|
- stage: Build
|
|
jobs:
|
|
- job: microblaze_build_test
|
|
variables:
|
|
BUILD_TYPE: microblaze
|
|
DTS_FILES: "arch/microblaze/boot/dts/*.dts"
|
|
steps:
|
|
- checkout: self
|
|
fetchDepth: 1
|
|
clean: true
|
|
- task: DownloadPipelineArtifact@2
|
|
inputs:
|
|
buildType: 'specific'
|
|
project: 'OpenSource'
|
|
definition: 56 # The ID of the buildroot pipeline to download microblaze rootfs
|
|
buildVersionToDownload: 'latest'
|
|
artifactName: 'mb_rootfs'
|
|
targetPath: '$(Agent.BuildDirectory)/s'
|
|
- script: ./ci/travis/run-build.sh
|
|
env:
|
|
DOWNLOAD_URL: $(DOWNLOAD_URL)
|
|
displayName: 'Microblaze Build Test'
|
|
- task: CopyFiles@2
|
|
inputs:
|
|
sourceFolder: '$(Agent.BuildDirectory)/s/arch/microblaze/boot'
|
|
contents: '?(*.strip)'
|
|
targetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
- task: PublishPipelineArtifact@1
|
|
inputs:
|
|
targetPath: '$(Build.ArtifactStagingDirectory)'
|
|
artifactName: 'Microblaze'
|
|
|
|
- job: dtb_build_test
|
|
variables:
|
|
BUILD_TYPE: dtb_build_test
|
|
DTS_FILES: "arch/arm/boot/dts/xilinx/zynq-*.dts
|
|
arch/arm/boot/dts/intel/socfpga/socfpga_*.dts
|
|
arch/arm64/boot/dts/xilinx/zynqmp-*.dts
|
|
arch/arm64/boot/dts/xilinx/versal-*.dts
|
|
arch/nios2/boot/dts/*.dts"
|
|
steps:
|
|
- checkout: self
|
|
fetchDepth: 1
|
|
clean: true
|
|
- script: ./ci/travis/run-build.sh
|
|
displayName: 'Device-Tree Build Test'
|
|
- task: CopyFiles@2
|
|
inputs:
|
|
sourceFolder: '$(Agent.BuildDirectory)/s/arch/arm/boot/dts/intel/socfpga'
|
|
contents: '$(Agent.BuildDirectory)/s/arch/arm/boot/dts/intel/socfpga/?(*.dtb)'
|
|
targetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
- task: CopyFiles@2
|
|
inputs:
|
|
sourceFolder: '$(Agent.BuildDirectory)/s/arch/arm/boot/dts/xilinx'
|
|
contents: '$(Agent.BuildDirectory)/s/arch/arm/boot/dts/xilinx/?(*.dtb)'
|
|
targetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
- task: CopyFiles@2
|
|
inputs:
|
|
sourceFolder: '$(Agent.BuildDirectory)/s/arch/arm64/boot/dts/xilinx'
|
|
contents: '$(Agent.BuildDirectory)/s/arch/arm64/boot/dts/xilinx/?(*.dtb)'
|
|
targetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
- task: PublishPipelineArtifact@1
|
|
inputs:
|
|
targetPath: '$(Build.ArtifactStagingDirectory)'
|
|
artifactName: 'DTBs'
|
|
|
|
- job: BuildDockerized
|
|
strategy:
|
|
matrix:
|
|
zynq_adi_default:
|
|
DEFCONFIG: zynq_xcomm_adv7511_defconfig
|
|
ARCH: arm
|
|
IMAGE: uImage
|
|
CHECK_ALL_ADI_DRIVERS_HAVE_BEEN_BUILT: 1
|
|
socfpga_adi_default:
|
|
DEFCONFIG: socfpga_adi_defconfig
|
|
ARCH: arm
|
|
IMAGE: zImage
|
|
CHECK_ALL_ADI_DRIVERS_HAVE_BEEN_BUILT: 1
|
|
zynqmp_adi_default:
|
|
DEFCONFIG: adi_zynqmp_defconfig
|
|
ARCH: arm64
|
|
IMAGE: Image
|
|
CHECK_ALL_ADI_DRIVERS_HAVE_BEEN_BUILT: 1
|
|
versal_adi_default:
|
|
DEFCONFIG: adi_versal_defconfig
|
|
ARCH: arm64
|
|
IMAGE: Image
|
|
CHECK_ALL_ADI_DRIVERS_HAVE_BEEN_BUILT: 1
|
|
zynq_pluto:
|
|
DEFCONFIG: zynq_pluto_defconfig
|
|
ARCH: arm
|
|
IMAGE: uImage
|
|
zynq_m2k:
|
|
DEFCONFIG: zynq_m2k_defconfig
|
|
ARCH: arm
|
|
IMAGE: uImage
|
|
steps:
|
|
- checkout: self
|
|
fetchDepth: 1
|
|
clean: true
|
|
- script: ./ci/travis/run-build-docker.sh
|
|
displayName: "Build test for '$(DEFCONFIG)'"
|
|
- task: CopyFiles@2
|
|
inputs:
|
|
sourceFolder: '$(Agent.BuildDirectory)/s/arch/arm/boot'
|
|
contents: '[uz]Image'
|
|
targetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
- task: CopyFiles@2
|
|
inputs:
|
|
sourceFolder: '$(Agent.BuildDirectory)/s/arch/arm64/boot'
|
|
contents: 'Image'
|
|
targetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
- task: PublishPipelineArtifact@1
|
|
inputs:
|
|
targetPath: '$(Build.ArtifactStagingDirectory)/'
|
|
artifactName: '$(DEFCONFIG)'
|
|
|
|
- stage: PushArtifacts
|
|
dependsOn: Build
|
|
variables:
|
|
SOURCE_DIRECTORY: $(Build.SourcesDirectory)/bin
|
|
jobs:
|
|
# Condition for publishing artifacts (same for Push_to_Artifactory and Publish_to_Cloudsmith):
|
|
# - PRs (non-fork) targeting: main, next_stable, or xlnx/release/ release branches
|
|
# - Direct pushes to: main, next_stable, or xlnx/release/ release branches
|
|
- job: Push_to_Artifactory
|
|
timeoutInMinutes: 120
|
|
pool:
|
|
name: Default
|
|
demands:
|
|
- agent.name -equals linux_default
|
|
condition: or(
|
|
and(
|
|
startsWith(variables['Build.SourceBranch'], 'refs/pull/'),
|
|
ne(variables['SYSTEM.PULLREQUEST.ISFORK'], 'true'),
|
|
or(
|
|
eq(variables['System.PullRequest.TargetBranch'], 'main'),
|
|
eq(variables['System.PullRequest.TargetBranch'], 'next_stable'),
|
|
startsWith(variables['System.PullRequest.TargetBranch'], 'xlnx/release/')
|
|
)
|
|
),
|
|
or(
|
|
eq(variables['Build.SourceBranch'], 'refs/heads/main'),
|
|
eq(variables['Build.SourceBranch'], 'refs/heads/next_stable'),
|
|
startsWith(variables['Build.SourceBranch'], 'refs/heads/xlnx/release/')
|
|
)
|
|
)
|
|
steps:
|
|
- checkout: self
|
|
fetchDepth: 1
|
|
clean: true
|
|
- task: DownloadPipelineArtifact@2
|
|
inputs:
|
|
path: $(Build.SourcesDirectory)/bin
|
|
- bash: ./ci/travis/prepare_artifacts.sh
|
|
env:
|
|
ARTIFACTORY_PATH: $(ART_BASE_PATH)
|
|
ARTIFACTORY_TOKEN: $(ART_TOKEN)
|
|
name: PushArtifacts
|
|
displayName: "Push to Artifactory"
|
|
- bash: |
|
|
cd $(Build.SourcesDirectory)/bin
|
|
TIMESTAMP=$(PushArtifacts.TIMESTAMP)
|
|
if [ -d "$TIMESTAMP" ]; then
|
|
echo "Cleaning up artifact directory: $TIMESTAMP"
|
|
rm -rf "$TIMESTAMP"
|
|
fi
|
|
displayName: "Cleanup artifacts"
|
|
condition: always()
|
|
- job: Publish_to_Cloudsmith
|
|
timeoutInMinutes: 120
|
|
condition: or(
|
|
and(
|
|
startsWith(variables['Build.SourceBranch'], 'refs/pull/'),
|
|
ne(variables['SYSTEM.PULLREQUEST.ISFORK'], 'true'),
|
|
or(
|
|
eq(variables['System.PullRequest.TargetBranch'], 'main'),
|
|
eq(variables['System.PullRequest.TargetBranch'], 'next_stable'),
|
|
startsWith(variables['System.PullRequest.TargetBranch'], 'xlnx/release/')
|
|
)
|
|
),
|
|
or(
|
|
eq(variables['Build.SourceBranch'], 'refs/heads/main'),
|
|
eq(variables['Build.SourceBranch'], 'refs/heads/next_stable'),
|
|
startsWith(variables['Build.SourceBranch'], 'refs/heads/xlnx/release/')
|
|
)
|
|
)
|
|
steps:
|
|
- checkout: self
|
|
fetchDepth: 1
|
|
clean: true
|
|
- checkout: wiki-scripts
|
|
fetchDepth: 1
|
|
clean: true
|
|
- task: DownloadPipelineArtifact@2
|
|
inputs:
|
|
path: $(Build.SourcesDirectory)/bin
|
|
- bash: |
|
|
python3 -m pip install --upgrade pip
|
|
pip3 install cloudsmith-cli
|
|
displayName: "Install Cloudsmith CLI"
|
|
- bash: bash $(Build.SourcesDirectory)/linux/ci/travis/prepare_artifacts_for_cloudsmith.sh
|
|
env:
|
|
CLOUDSMITH_API_KEY: $(CLOUDSMITH_API_KEY)
|
|
name: PushArtifacts
|
|
displayName: "Push to Cloudsmith"
|
|
- bash: |
|
|
cd $(Build.SourcesDirectory)/bin
|
|
TIMESTAMP=$(PushArtifacts.TIMESTAMP)
|
|
if [ -d "$TIMESTAMP" ]; then
|
|
echo "Cleaning up artifact directory: $TIMESTAMP"
|
|
rm -rf "$TIMESTAMP"
|
|
fi
|
|
displayName: "Cleanup artifacts"
|
|
condition: always()
|
|
- stage: TestHarness
|
|
dependsOn: PushArtifacts
|
|
condition: succeeded()
|
|
jobs:
|
|
- job: Test
|
|
condition: ne(stageDependencies.PushArtifacts.Push_to_Artifactory.result, 'Skipped')
|
|
variables:
|
|
TIMESTAMP: $[ stageDependencies.PushArtifacts.Push_to_Artifactory.outputs['PushArtifacts.TIMESTAMP'] ]
|
|
BRANCH: $[ stageDependencies.PushArtifacts.Push_to_Artifactory.outputs['PushArtifacts.BRANCH'] ]
|
|
PR_ID: $[ stageDependencies.PushArtifacts.Push_to_Artifactory.outputs['PushArtifacts.PR_ID'] ]
|
|
steps:
|
|
- checkout: none
|
|
- script: |
|
|
curl $(JENKINS_URL)/job/Linux_TH/buildWithParameters \
|
|
--user $(JENKINS_USER):$(JENKINS_PASSWORD) \
|
|
--data TIMESTAMP=$(TIMESTAMP) \
|
|
--data BRANCH=$(BRANCH) \
|
|
--data PR_ID=$(PR_ID)
|