diff --git a/Jenkinsfile b/Jenkinsfile index 0c97b9b0..bd56341b 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -78,11 +78,12 @@ pipeline { do sleep 10 done - sbt clean flowLint test scalafmtSbtCheck scalafmtCheck doc ''' + sh 'sbt clean flowLint coverage test scalafmtSbtCheck scalafmtCheck doc' + sh 'sbt coverageAggregate' } finally { - junit allowEmptyResults: true, testResults: '**/target/test-reports/*.xml' + postSbtReport() } } } diff --git a/build.sbt b/build.sbt index 37d2ff2e..d7a4ad04 100644 --- a/build.sbt +++ b/build.sbt @@ -127,5 +127,11 @@ lazy val commonSettings: Seq[Setting[_]] = Seq( scalacOptions ++= allScalacOptions, credentials += credsToUse, resolvers += "Artifactory" at "https://flow.jfrog.io/flow/libs-release/", + coverageExcludedFiles := ".*\\/*generated*\\/.*", + coverageDataDir := file("target/scala-2.13"), + coverageHighlighting := true, + coverageFailOnMinimum := true, + coverageMinimumStmtTotal := 36, + coverageMinimumBranchTotal := 36, ) version := "0.8.43" diff --git a/project/plugins.sbt b/project/plugins.sbt index 7b872555..379ab97e 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -25,3 +25,4 @@ ThisBuild / libraryDependencySchemes ++= Seq( ) addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.8")