diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..7d79c79 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,21 @@ +version: 2.1 + +jobs: + build: + docker: + - image: chatwork/sbt-ci-openjdk8:jdk8u252-b09-1.3.10 + steps: + - checkout + - run: + name: "coverage" + command: sbt -mem 2048 test coverage coverageReport + - sonarcloud/scan + +orbs: + sonarcloud: sonarsource/sonarcloud@1.0.1 + +workflows: + main: + jobs: + - build: + context: SonarCloud \ No newline at end of file diff --git a/build.sbt b/build.sbt index f2bb7f0..9608158 100644 --- a/build.sbt +++ b/build.sbt @@ -13,5 +13,6 @@ lazy val root: Project = (project in file(".")) ), libraryDependencies ++= Seq( "org.scalatest" %% "scalatest" % "3.1.1" % Test - ) - ) + ), + coverageEnabled := true + ) \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index a37251a..00b2159 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1 +1,2 @@ -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..71bac1d --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,14 @@ +sonar.host.url=https://sonarcloud.io +sonar.organization=chatwork-sonar +sonar.projectName=scala-quiz +sonar.projectKey=chatwork_scala-quiz + +sonar.sourceEncoding=UTF-8 + +sonar.sources=src/main +sonar.tests=src/test + +sonar.language=scala + +sonar.scala.scoverage.reportPath=\ + target/scala-2.13/scoverage-report