forked from kolmafia/kolmafia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkinsfile
61 lines (60 loc) · 2.22 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
pipeline {
agent any
stages {
stage('Git Update') {
steps {
cleanWs()
script {
checkout([$class: 'GitSCM', branches: [
[name: '*/main']
], extensions: [
[$class: 'CloneOption', depth: 1000000, noTags: false, reference: '', shallow: true]
], userRemoteConfigs: [
[url: 'https://github.com/kolmafia/kolmafia']
]])
}
}
}
stage('Building') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
retry(3) {
script {
withEnv(["JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-amd64"]) {
sh 'ls'
sh 'java --version'
sh './gradlew -v'
sh './gradlew --no-daemon clean shadowJar'
}
}
}
}
}
}
stage('Testing') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
retry(3) {
wrap([$class: 'Xvfb']) {
script {
withEnv(["JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-amd64"]) {
sh './gradlew --no-daemon --stacktrace jacocoTestReport'
jacoco buildOverBuild: true, changeBuildStatus: true, deltaBranchCoverage: '5', deltaClassCoverage: '5', deltaComplexityCoverage: '5', deltaInstructionCoverage: '5', deltaLineCoverage: '5', deltaMethodCoverage: '5', maximumBranchCoverage: '70', maximumClassCoverage: '70', maximumComplexityCoverage: '70', maximumInstructionCoverage: '70', maximumLineCoverage: '70', maximumMethodCoverage: '70', runAlways: true
publishCoverage adapters: [jacocoAdapter(mergeToOneReport: true, path: 'build/reports/jacoco/test/jacocoTestReport.xml')], sourceFileResolver: sourceFiles('NEVER_STORE')
publishHTML([allowMissing: true, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'build/reports/jacoco/test/html/', reportFiles: 'index.html', reportName: 'JaCoCo Test Report', reportTitles: ''])
}
}
}
}
}
}
}
stage('Archiving') {
steps {
script {
archiveArtifacts 'dist/*.jar'
}
}
}
}
}