Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add action-junit-report #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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@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
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", "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")),
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
Loading