-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
45 lines (34 loc) · 997 Bytes
/
Jenkinsfile
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
#!groovy
//1
stage 'clone_AssignmentProject'
node {
checkout scm
}
//2
stage 'Clean'
node{
sh 'chmod +x gradlew'
sh './gradlew clean --info'
stash excludes: 'build/', includes: '**', name: 'source'
}
stage 'Unit Test'
node{
sh './gradlew test --info'
stash includes: 'build/jacoco/*.exec', name: 'unitCodeCoverage'
stash includes: 'integration-test/build/jacoco/*.exec', name: 'commitIntegrationCodeCoverage'
// publish JUnit results to Jenkins
step([$class: 'JUnitResultArchiver', testResults: '**/build/test-results/*.xml'])
}
stage 'Code Quality'
node {
parallel (
'jacoco': {
// jacoco report rendering
unstash 'source'
unstash 'unitCodeCoverage'
unstash 'commitIntegrationCodeCoverage'
gradle.aggregateJaCoCoReports()
publishHTML(target: [reportDir:'build/reports/jacoco/jacocoRootTestReport/html', reportFiles: 'index.html', reportName: 'Code Coverage'])
}
)
}