Skip to content

Commit 677931b

Browse files
authored
#146 CI reports for checkstyle & tests (#147)
1 parent 7ce3335 commit 677931b

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

Jenkinsfile

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,18 @@ pipeline {
1010
stage ('Build: Plain Maven (M2)') {
1111
steps {
1212
// ignore test failures since we parse the test results afterwards
13-
sh 'mvn clean verify -Pm2 -B -Dmaven.test.failure.ignore=true'
13+
timeout(30) {
14+
sh 'mvn clean verify -Pm2 -B -Dmaven.test.failure.ignore=true'
15+
}
1416
}
1517
}
1618

1719
stage ('Build: Eclipse-based (P2)') {
1820
steps {
1921
// ignore test failures since we parse the test results afterwards
20-
sh 'mvn clean verify -Pp2 -B -Dmaven.test.failure.ignore=true'
21-
}
22-
}
23-
24-
stage ('Generate: Reports') {
25-
steps {
26-
junit '**/surefire-reports/*.xml'
27-
recordIssues failOnError: true, qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]],
28-
tools: [checkStyle(pattern: '**/target/checkstyle-result.xml', reportEncoding: 'UTF-8')]
22+
timeout(30) {
23+
sh 'mvn clean verify -Pp2 -B -Dmaven.test.failure.ignore=true'
24+
}
2925
}
3026
}
3127

@@ -43,4 +39,21 @@ pipeline {
4339
}
4440
}
4541
}
42+
43+
post {
44+
always {
45+
// Record & publish checkstyle issues
46+
recordIssues enabledForFailure: true, publishAllIssues: true,
47+
tool: checkStyle(reportEncoding: 'UTF-8'),
48+
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
49+
50+
// Record & publish test results
51+
withChecks('Tests') {
52+
junit 'tests/**/surefire-reports/*.xml'
53+
}
54+
55+
// Record maven,java warnings
56+
recordIssues enabledForFailure: true, skipPublishingChecks:true, tools: [mavenConsole(), java()]
57+
}
58+
}
4659
}

0 commit comments

Comments
 (0)