diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61602b2..a1daaa0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,8 +51,13 @@ jobs: - name: Check that workflows are up to date run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck - - name: Build project - run: sbt '++ ${{ matrix.scala }}' test + - name: Run tests + run: sbt '++ ${{ matrix.scala }}' scalafmtCheck scalafmtSbtCheck test + + - name: Publish test reports + uses: mikepenz/action-junit-report@v4 + with: + report_paths: target/test-reports/TEST-*.xml - name: Compress target directories run: tar cf targets.tar target scalatest-otel-reporter/target project/target diff --git a/build.sbt b/build.sbt index 752bff3..342eb0c 100644 --- a/build.sbt +++ b/build.sbt @@ -15,6 +15,14 @@ ThisBuild / developers := List( // sbt-github-actions ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("17"), JavaSpec.temurin("11")) ThisBuild / githubWorkflowTargetTags ++= Seq("v*") +ThisBuild / githubWorkflowBuild := Seq( + WorkflowStep.Sbt(List("scalafmtCheck", "scalafmtSbtCheck", "test"), name = Some("Run tests")), + WorkflowStep.Use( + UseRef.Public("mikepenz", "action-junit-report", "v4"), + Map("report_paths" -> "target/test-reports/TEST-*.xml"), + name = Some("Publish test reports"), + ), +) ThisBuild / githubWorkflowPublishTargetBranches := Seq( RefPredicate.StartsWith(Ref.Tag("v")), RefPredicate.Equals(Ref.Branch("main")), @@ -36,6 +44,7 @@ lazy val root = (project in file(".")) .aggregate(`scalatest-otel-reporter`) .settings( publish / skip := true, + Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-u", "target/test-reports"), ) lazy val `scalatest-otel-reporter` = (project in file("scalatest-otel-reporter"))