Skip to content

Commit

Permalink
Add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mdedetrich committed Mar 2, 2022
1 parent 66a4b50 commit 29e65fd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,10 @@ jobs:
run: sbt ++${{ matrix.scala }} githubWorkflowCheck

- name: Build project
run: sbt ++${{ matrix.scala }} test
run: sbt ++${{ matrix.scala }} clean coverage test

- name: Upload coverage data to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: Scala ${{ matrix.scala }}
run: sbt ++${{ matrix.scala }} coverageReport coverageAggregate coveralls
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Build Status](https://github.com/aiven/guardian-for-apache-kafka/actions/workflows/ci.yml/badge.svg)](https://github.com/aiven/guardian-for-apache-kafka/actions)
[![Apache License](https://img.shields.io/badge/license-APACHE_2-green.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![Coverage](https://coveralls.io/repos/github/aiven/guardian-for-apache-kafka/badge.svg?branch=main)](https://coveralls.io/github/aiven/guardian-for-apache-kafka?branch=main)

# Guardian for Apache Kafka®

Expand Down
16 changes: 16 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,22 @@ ThisBuild / githubWorkflowEnv ++= Map(

ThisBuild / githubWorkflowJavaVersions := List(JavaSpec.temurin("11"))

ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(List("clean", "coverage", "test"), name = Some("Build project"))
)

ThisBuild / githubWorkflowBuildPostamble ++= Seq(
// See https://github.com/scoverage/sbt-coveralls#github-actions-integration
WorkflowStep.Sbt(
List("coverageReport", "coverageAggregate", "coveralls"),
name = Some("Upload coverage data to Coveralls"),
env = Map(
"COVERALLS_REPO_TOKEN" -> "${{ secrets.GITHUB_TOKEN }}",
"COVERALLS_FLAG_NAME" -> "Scala ${{ matrix.scala }}"
)
)
)

import ReleaseTransformations._

releaseCrossBuild := true
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.34")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1")

0 comments on commit 29e65fd

Please sign in to comment.