forked from Azure/qpid-proton-j-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.yml
141 lines (124 loc) · 4.46 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
resources:
repositories:
- repository: azure-sdk-build-tools
type: git
name: internal/azure-sdk-build-tools
trigger:
branches:
include:
- master
- feature/*
- release/*
- hotfix/*
pr:
branches:
include:
- master
- feature/*
- release/*
- hotfix/*
variables:
DefaultOptions: '--batch-mode -Dmaven.wagon.http.pool=false'
LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
stages:
- stage: Build
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/qpid-proton-j-extensions/**/* $(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.15'
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.15'
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)'
# The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch.
- ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}:
- template: pipelines/stages/archetype-java-release.yml@azure-sdk-build-tools
parameters:
DependsOn: Build
ArtifactName: packages
Artifacts:
- name: qpid-proton-j-extensions
safeName: qpidprotonjextensions
stagingProfileId: 534d15ee3800f4