Skip to content

Commit

Permalink
chore: Add action-junit-report
Browse files Browse the repository at this point in the history
  • Loading branch information
NomadBlacky committed Sep 18, 2023
1 parent 65a0c28 commit 3dc356e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@4
with:
report_dir: target/test-reports

- name: Compress target directories
run: tar cf targets.tar target scalatest-otel-reporter/target project/target
Expand Down
9 changes: 9 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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", "4"),
Map("report_dir" -> "target/test-reports"),
name = Some("Publish test reports"),
),
)
ThisBuild / githubWorkflowPublishTargetBranches := Seq(
RefPredicate.StartsWith(Ref.Tag("v")),
RefPredicate.Equals(Ref.Branch("main")),
Expand All @@ -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"))
Expand Down

0 comments on commit 3dc356e

Please sign in to comment.