forked from jamesmudd/jhdf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
143 lines (131 loc) · 4.12 KB
/
azure-pipelines.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
142
143
# File for Azure Piplelines CI Builds
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
variables:
osName: Linux
strategy:
matrix:
Java 8:
java.version: '1.8'
Java 11:
java.version: '1.11'
steps:
# Build using a Gradle wrapper script
- task: Gradle@2
displayName: Build + Test
inputs:
gradleWrapperFile: 'jhdf/gradlew'
workingDirectory: jhdf
tasks: 'clean build jacocoTestReport'
publishJUnitResults: true
testResultsFiles: 'jhdf/build/test-results/test/TEST-*.xml'
testRunTitle: $(osName) $(Agent.JobName)
jdkVersionOption: $(java.version)
# Publish JaCoCo code coverage results
- task: PublishCodeCoverageResults@1
displayName: Publish Code Coverage
inputs:
codeCoverageTool: 'jaCoCo' # Options: cobertura, jaCoCo
summaryFileLocation: jhdf/build/reports/jacoco/test/*.xml
reportDirectory: jhdf/build/reports/jacoco/test/html
# Source + JavaDoc
- task: Gradle@2
displayName: Build Sources + JavaDoc Jars
inputs:
gradleWrapperFile: 'jhdf/gradlew'
workingDirectory: jhdf
tasks: 'sourcesJar javadocJar'
jdkVersionOption: $(java.version)
publishJUnitResults: false
# SonarQube
- script: 'cd jhdf;
./gradlew sonarqube
-Dsonar.projectKey=jamesmudd_jhdf
-Dsonar.organization=jamesmudd-github
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.login=$(sonar.login)
-Dsonar.java.spotbugs.reportPaths=./build/reports/spotbugs/main.xml,./build/reports/spotbugs/test.xml'
displayName: SonarQube
# Only run for Java 1.8 and not for PR
condition: and(eq(variables['java.version'], '1.8'), ne(variables['Build.Reason'], 'PullRequest'))
# SonarQube for Pull requests
- script: 'cd jhdf;
./gradlew sonarqube
-Dsonar.projectKey=jamesmudd_jhdf
-Dsonar.organization=jamesmudd-github
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.login=$(sonar.login)
-Dsonar.java.spotbugs.reportPaths=./build/reports/spotbugs/main.xml,./build/reports/spotbugs/test.xml
-Dsonar.pullrequest.branch=$(Build.SourceBranch)
-Dsonar.pullrequest.key=$(System.PullRequest.PullRequestNumber)
-Dsonar.pullrequest.base=$(System.PullRequest.TargetBranch)
-Dsonar.pullrequest.github.repository=$(Build.Repository.Uri)'
displayName: SonarQube PR
# Only run for Java 1.8 and PR
condition: and(eq(variables['java.version'], '1.8'), eq(variables['Build.Reason'], 'PullRequest'))
- job: Windows
pool:
vmImage: 'vs2017-win2016'
variables:
osName: Windows
strategy:
matrix:
Java 8:
java.version: '1.8'
Java 11:
java.version: '1.11'
steps:
# Build using a Gradle wrapper script
- task: Gradle@2
displayName: Build/Test
inputs:
gradleWrapperFile: 'jhdf/gradlew'
workingDirectory: jhdf
tasks: 'build'
publishJUnitResults: true
testResultsFiles: 'jhdf/build/test-results/test/TEST-*.xml'
testRunTitle: $(osName) $(Agent.JobName)
jdkVersionOption: $(java.version)
# Source + JavaDoc
- task: Gradle@2
displayName: Build Sources + JavaDoc Jars
inputs:
gradleWrapperFile: 'jhdf/gradlew'
workingDirectory: jhdf
tasks: 'sourcesJar javadocJar'
jdkVersionOption: $(java.version)
publishJUnitResults: false
- job: Mac
pool:
vmImage: 'macOS-10.13'
variables:
osName: Mac
strategy:
matrix:
Java 8:
java.version: '1.8'
Java 11:
java.version: '1.11'
steps:
# Build using a Gradle wrapper script
- task: Gradle@2
displayName: Build/Test
inputs:
gradleWrapperFile: 'jhdf/gradlew'
workingDirectory: jhdf
tasks: 'build'
publishJUnitResults: true
testResultsFiles: 'jhdf/build/test-results/test/TEST-*.xml'
testRunTitle: $(osName) $(Agent.JobName)
jdkVersionOption: $(java.version)
# Source + JavaDoc
- task: Gradle@2
displayName: Build Sources + JavaDoc Jars
inputs:
gradleWrapperFile: 'jhdf/gradlew'
workingDirectory: jhdf
tasks: 'sourcesJar javadocJar'
jdkVersionOption: $(java.version)
publishJUnitResults: false