ci(automation): pre-ci setup
This commit is contained in:
parent
15ad7a2fb7
commit
4e623fada6
11 changed files with 293 additions and 185 deletions
|
|
@ -2,6 +2,7 @@ plugins {
|
|||
id 'java'
|
||||
id 'org.springframework.boot' version '3.5.6'
|
||||
id 'io.spring.dependency-management' version '1.1.7'
|
||||
id 'jacoco'
|
||||
}
|
||||
|
||||
group = 'io.github.js0ny'
|
||||
|
|
@ -26,6 +27,56 @@ dependencies {
|
|||
|
||||
}
|
||||
|
||||
jacoco {
|
||||
toolVersion = "0.8.12"
|
||||
}
|
||||
|
||||
tasks.named('test') {
|
||||
useJUnitPlatform()
|
||||
finalizedBy jacocoTestReport
|
||||
}
|
||||
|
||||
jacocoTestReport {
|
||||
dependsOn test
|
||||
|
||||
reports {
|
||||
xml.required = true
|
||||
html.required = true
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
classDirectories.setFrom(files(classDirectories.files.collect {
|
||||
fileTree(dir: it, exclude: [
|
||||
'**/IlpCourseworkApplication.class',
|
||||
'**/config/*',
|
||||
'**/data/*',
|
||||
'**/util/*'
|
||||
])
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
jacocoTestCoverageVerification {
|
||||
violationRules {
|
||||
rule {
|
||||
element = 'CLASS'
|
||||
|
||||
excludes = [
|
||||
'io.github.js0ny.IlpCourseworkApplication',
|
||||
'**.config.**',
|
||||
'**.data.**',
|
||||
'**.util.**'
|
||||
]
|
||||
|
||||
limit {
|
||||
counter = 'BRANCH'
|
||||
value = 'COVEREDRATIO'
|
||||
|
||||
// minimum = 0.50
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
check.dependsOn jacocoTestCoverageVerification
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue