104 строки
3.5 KiB
YAML
104 строки
3.5 KiB
YAML
stages:
|
|
- stage: Build
|
|
variables:
|
|
DefaultOptions: '--batch-mode -Dmaven.wagon.http.pool=false'
|
|
LoggingOptions: '-Xdiag -Dorg.slf4j.simpleLogger.defaultLogLevel=debug -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
|
|
|
|
jobs:
|
|
- job: 'Build'
|
|
|
|
pool:
|
|
vmImage: 'ubuntu-16.04'
|
|
|
|
strategy:
|
|
matrix:
|
|
Java 8:
|
|
ArtifactName: 'packages'
|
|
ProfileFlag: ''
|
|
JavaVersion: '1.8'
|
|
Java LTS:
|
|
ArtifactName: 'java-lts-packages'
|
|
ProfileFlag: '-Djava-lts'
|
|
JavaVersion: '1.11'
|
|
|
|
steps:
|
|
- task: Maven@3
|
|
displayName: 'Build and Package'
|
|
inputs:
|
|
mavenPomFile: 'pom.xml'
|
|
goals: 'deploy'
|
|
options: '$(DefaultOptions) $(ProfileFlag) -DaltDeploymentRepository="local::default::file:///${project.basedir}/output" -Dmaven.test.skip=true --settings eng/settings.xml'
|
|
mavenOptions: '$(LoggingOptions)'
|
|
javaHomeOption: 'JDKVersion'
|
|
jdkVersionOption: $(JavaVersion)
|
|
jdkArchitectureOption: 'x64'
|
|
publishJUnitResults: false
|
|
|
|
- script: |
|
|
cp output/com/microsoft/azure/azure-internet-analyzer-java/**/* $(Build.ArtifactStagingDirectory)
|
|
rm $(Build.ArtifactStagingDirectory)/*.sha1
|
|
rm $(Build.ArtifactStagingDirectory)/*.md5
|
|
|
|
displayName: Flatten and copy build outputs
|
|
|
|
- publish: $(Build.ArtifactStagingDirectory)
|
|
artifact: $(ArtifactName)
|
|
displayName: 'Publish outputs to $(ArtifactName) artifact'
|
|
|
|
- job: 'Test'
|
|
|
|
strategy:
|
|
matrix:
|
|
Linux - Java 8:
|
|
OSName: 'Linux'
|
|
OSVmImage: 'ubuntu-16.04'
|
|
ProfileFlag: ''
|
|
JavaVersion: '1.8'
|
|
macOS - Java 8:
|
|
OSName: 'macOS'
|
|
OSVmImage: 'macOS-10.13'
|
|
ProfileFlag: ''
|
|
JavaVersion: '1.8'
|
|
Windows - Java 8:
|
|
OSName: 'Windows'
|
|
OSVmImage: 'vs2017-win2016'
|
|
ProfileFlag: ''
|
|
JavaVersion: '1.8'
|
|
# Linux - Java LTS:
|
|
# OSName: 'Linux'
|
|
# OSVmImage: 'ubuntu-16.04'
|
|
# ProfileFlag: '-Djava-lts'
|
|
# JavaVersion: '1.11'
|
|
macOS - Java LTS:
|
|
OSName: 'macOS'
|
|
OSVmImage: 'macOS-10.13'
|
|
ProfileFlag: '-Djava-lts'
|
|
JavaVersion: '1.11'
|
|
Windows - Java LTS:
|
|
OSName: 'Windows'
|
|
OSVmImage: 'vs2017-win2016'
|
|
ProfileFlag: '-Djava-lts'
|
|
JavaVersion: '1.11'
|
|
|
|
pool:
|
|
vmImage: $(OSVmImage)
|
|
|
|
steps:
|
|
- task: Maven@3
|
|
displayName: 'Run Tests'
|
|
inputs:
|
|
mavenPomFile: 'pom.xml'
|
|
options: '$(DefaultOptions) $(ProfileFlag) --settings eng/settings.xml'
|
|
mavenOptions: '-Xmx3072m $(LoggingOptions)'
|
|
javaHomeOption: 'JDKVersion'
|
|
jdkVersionOption: $(JavaVersion)
|
|
jdkArchitectureOption: 'x64'
|
|
publishJUnitResults: false
|
|
goals: 'test'
|
|
|
|
- task: PublishTestResults@2
|
|
condition: succeededOrFailed()
|
|
inputs:
|
|
mergeTestResults: true
|
|
testRunTitle: '$(OSName) on Java $(JavaVersion)'
|