Compare commits
10 Commits
1.0.8.post
...
1.0.8.post
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e74a53e3bf | ||
|
|
ef7469f35b | ||
|
|
9e5f0de5c4 | ||
|
|
99f38741fd | ||
|
|
eee2bf551c | ||
|
|
01ce809823 | ||
|
|
4ab70409a0 | ||
|
|
7b9752a17a | ||
|
|
879a7ca03d | ||
|
|
bd3389aeb2 |
22
Jenkinsfile
vendored
22
Jenkinsfile
vendored
@@ -12,6 +12,7 @@ import javax.xml.xpath.*
|
||||
import groovy.xml.DOMBuilder
|
||||
import groovy.xml.dom.DOMCategory
|
||||
import java.math.RoundingMode
|
||||
import java.math.BigDecimal
|
||||
|
||||
// configurable settings:
|
||||
// use to send email if workflow problem
|
||||
@@ -34,8 +35,9 @@ def _MkDocsWebCredentials = "2c5b684e-3787-4b37-8aca-b3dd4a383fe2"
|
||||
def _PypiCredentials = "Pypi"
|
||||
|
||||
|
||||
def badge_coverage = addEmbeddableBadgeConfiguration(id: "coverage", subject: "unit-test coverage")
|
||||
def badge_complexity = addEmbeddableBadgeConfiguration(id: "complexity", subject: "code complexity")
|
||||
def badge_coverage = addEmbeddableBadgeConfiguration(id: "coverage", subject: "coverage")
|
||||
def badge_complexity = addEmbeddableBadgeConfiguration(id: "complexity", subject: "code complexity")
|
||||
def badge_quality = addEmbeddableBadgeConfiguration(id: "quality", subject: "quality score")
|
||||
|
||||
// commands Helper: /!\ Made for GITEA /!\
|
||||
String determineRepoUserName() {
|
||||
@@ -91,7 +93,7 @@ int GetCoverageValue_line_rate(String CoverageFilePath) { return GetCoverageValu
|
||||
int GetCoverageValue_branches_valid(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branches-valid") }
|
||||
int GetCoverageValue_branches_covered(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branches-covered") }
|
||||
int GetCoverageValue_branch_rate(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branch-rate") }
|
||||
int GetCoverageValue_branches_complexity(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branches-complexity") }
|
||||
int GetCoverageValue_complexity(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@complexity") }
|
||||
|
||||
|
||||
pipeline {
|
||||
@@ -365,6 +367,10 @@ pipeline {
|
||||
steps {
|
||||
dir("gitrepo") {
|
||||
sh(". ~/TEST_ENV/bin/activate && python -m helpers --type-check --quality-check")
|
||||
script {
|
||||
def jsonObj = readJSON file: "helpers-results/quality_check/metrics.json"
|
||||
badge_quality.setStatus(Double.toString(jsonObj["GlobalScore"]))
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
@@ -439,14 +445,14 @@ pipeline {
|
||||
println GetCoverageValue_branches_valid(coverage_report_path)
|
||||
println GetCoverageValue_branches_covered(coverage_report_path)
|
||||
println GetCoverageValue_branch_rate(coverage_report_path)
|
||||
println GetCoverageValue_branches_complexity(coverage_report_path)
|
||||
println GetCoverageValue_complexity(coverage_report_path)
|
||||
|
||||
full_rate = (GetCoverageValue_line_rate(coverage_report_path) + GetCoverageValue_branch_rate(coverage_report_path)) / 2
|
||||
sz_full_rate =Float.toString(full_rate.setScale(2, RoundingMode.HALF_EVEN))
|
||||
full_rate = new BigDecimal( (GetCoverageValue_line_rate(coverage_report_path) + GetCoverageValue_branch_rate(coverage_report_path)) / 2 )
|
||||
sz_full_rate = full_rate.setScale(2, RoundingMode.HALF_EVEN).toString()
|
||||
badge_coverage.setStatus(sz_full_rate)
|
||||
|
||||
complexity = GetCoverageValue_branches_complexity(coverage_report_path)
|
||||
sz_complexity =Float.toString(complexity.setScale(2, RoundingMode.HALF_EVEN))
|
||||
complexity = new BigDecimal( GetCoverageValue_complexity(coverage_report_path))
|
||||
sz_complexity = complexity.setScale(2, RoundingMode.HALF_EVEN).toString()
|
||||
badge_complexity.setStatus(sz_complexity)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
|
||||
Reference in New Issue
Block a user