qpid-proton-j-extensions/ci.yml

191 строка
6.3 KiB
YAML

trigger:
branches:
include:
- master
- feature/*
- release/*
- hotfix/*
pr:
branches:
include:
- master
- feature/*
- release/*
- hotfix/*
parameters:
- name: CopyToPartnerDrops
type: boolean
default: false
- name: VersionNumber
type: string
default: "<invalid-version-number>"
variables:
- name: TargetFolderName
value: $(Build.ArtifactStagingDirectory)/artifacts
extends:
template: /eng/templates/1es-redirect.yml
parameters:
stages:
- stage: Build
variables:
- name: DefaultOptions
value: '--batch-mode --fail-at-end -Dmaven.wagon.http.pool=false'
- name: LoggingOptions
value: '-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
- name: MemoryOptions
value: '-Xmx3072m'
- template: /eng/templates/image.yml
jobs:
- job: 'Build'
pool:
name: $(LINUXPOOL)
image: $(LINUXVMIMAGE)
os: linux
strategy:
matrix:
Java 8:
ArtifactName: 'java8-packages'
ProfileFlag: '-Djava8'
JavaVersion: '1.8'
# We name this 'packages' because it is the default version we want to ship with.
Java LTS:
ArtifactName: 'packages'
ProfileFlag: '-Djava-lts'
JavaVersion: '1.11'
steps:
# Build and deploy into "${project.basedir}/output" folder.
- task: Maven@3
displayName: 'Build and Package'
inputs:
mavenPomFile: 'pom.xml'
goals: 'deploy'
options: '$(DefaultOptions) $(ProfileFlag) -T 1C -DskipTests -Dgpg.skip -Dcheckstyle.skip=true -Dspotbugs.skip=true --settings eng/settings.xml -DaltDeploymentRepository="local::default::file:///${project.basedir}/output"'
mavenOptions: '$(LoggingOptions) $(MemoryOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaVersion)
jdkArchitectureOption: 'x64'
publishJUnitResults: false
- task: Maven@3
displayName: 'Run SpotBugs, Checkstyle, and Javadoc'
inputs:
mavenPomFile: pom.xml
options: '$(DefaultOptions) --no-transfer-progress -DskipTests -Dgpg.skip'
mavenOptions: '$(MemoryOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaVersion)
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'verify'
- script: |
mkdir $(TargetFolderName)
cp output/com/microsoft/azure/qpid-proton-j-extensions/**/* $(TargetFolderName)
rm $(TargetFolderName)/*.sha1
rm $(TargetFolderName)/*.md5
displayName: Flatten and copy build outputs
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish outputs to $(ArtifactName) artifact'
inputs:
artifactName: $(ArtifactName)
targetPath: $(Build.ArtifactStagingDirectory)
- job:
displayName: 'Test'
strategy:
matrix:
Linux - Java 8:
OSName: 'Linux'
OSVmImage: 'ubuntu-22.04'
ProfileFlag: '-Djava8'
JavaVersion: '1.8'
Linux - Java LTS:
OSName: 'Linux'
OSVmImage: 'ubuntu-22.04'
ProfileFlag: '-Djava-lts'
JavaVersion: '1.11'
pool:
name: $(LINUXPOOL)
image: $(LINUXVMIMAGE)
os: linux
steps:
- template: /eng/templates/test-steps.yml
- job:
displayName: 'Test'
strategy:
matrix:
Windows - Java 8:
OSName: 'Windows'
OSVmImage: 'windows-2022'
ProfileFlag: '-Djava8'
JavaVersion: '1.8'
Windows - Java LTS:
OSName: 'Windows'
OSVmImage: 'windows-2022'
ProfileFlag: '-Djava-lts'
JavaVersion: '1.11'
pool:
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows
steps:
- template: /eng/templates/test-steps.yml
- job:
displayName: 'Test'
strategy:
matrix:
macOS - Java 8:
OSName: 'macOS'
OSVmImage: 'macOS-13'
ProfileFlag: '-Djava8'
JavaVersion: '1.8'
macOS - Java LTS:
OSName: 'macOS'
OSVmImage: 'macOS-13'
ProfileFlag: '-Djava-lts'
JavaVersion: '1.11'
pool:
name: $(MACPOOL)
vmImage: $(MACVMIMAGE)
os: macOS
steps:
- template: /eng/templates/test-steps.yml
- ${{ if and(eq(parameters.CopyToPartnerDrops, true), ne(parameters.VersionNumber, '<invalid-version-number>')) }}:
- stage: Deploy
dependsOn: Build
jobs:
- job:
displayName: 'Copy to partner drop'
pool:
name: $(LINUXPOOL)
image: $(LINUXVMIMAGE)
os: linux
steps:
- download: current
# Make sure this matches up with the Java LTS artifact name in line 49.
artifact: packages
- task: AzureFileCopy@6
inputs:
SourcePath: '$(Pipeline.Workspace)/packages/artifacts'
azureSubscription: 'azuresdkpartnerdrops-kv Secrets'
Destination: 'AzureBlob'
storage: 'azuresdkscratch'
ContainerName: 'drops'
BlobPrefix: 'qpid-proton-j-extensions/java/${{ parameters.VersionNumber }}'