diff --git a/Jenkinsfile b/Jenkinsfile index 0c97b9b0..6e4ba480 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -78,11 +78,12 @@ pipeline { do sleep 10 done - sbt clean flowLint test scalafmtSbtCheck scalafmtCheck doc + sbt clean coverage flowLint 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 c939790c..2ca508c3 100644 --- a/build.sbt +++ b/build.sbt @@ -6,6 +6,12 @@ ThisBuild / scalaVersion := "2.13.10" ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always + coverageDataDir := file("target/scala-2.13") + coverageHighlighting := true + coverageFailOnMinimum := true + coverageMinimumStmtTotal := 0 + coverageMinimumBranchTotal := 0 + lazy val allScalacOptions = Seq( "-feature", "-Xfatal-warnings", @@ -15,6 +21,7 @@ lazy val allScalacOptions = Seq( "-Ypatmat-exhaust-depth", "100", // Fixes: Exhaustivity analysis reached max recursion depth, not all missing cases are reported. "-Wconf:src=generated/.*:silent", + "-Wconf:cat=unused-nowarn:s", "-Wconf:src=target/.*:silent", // silence the unused imports errors generated by the Play Routes ) @@ -126,11 +133,6 @@ lazy val commonSettings: Seq[Setting[_]] = Seq( ), scalacOptions ++= allScalacOptions, coverageExcludedFiles := ".*\\/generated\\/.*;.*\\/api/app/generated\\/.*;.*\\/api/app/db/generated\\/.*", - coverageDataDir := file("target/scala-2.13"), - coverageHighlighting := true, - coverageFailOnMinimum := true, - coverageMinimumStmtTotal := 0, - coverageMinimumBranchTotal := 0, credentials += credsToUse, resolvers += "Artifactory" at "https://flow.jfrog.io/flow/libs-release/", ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 1277e3b1..113acbd5 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -25,4 +25,4 @@ ThisBuild / libraryDependencySchemes ++= Seq( ) addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11") \ No newline at end of file