Skip to content

Commit

Permalink
Run CI for benchmarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
tarao committed Feb 28, 2024
1 parent 31fc7dc commit 5388724
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,37 @@ jobs:
modules-ignore: benchmark_3_3 benchmark_2_11_2.11 rootjs_3 docs_3 benchmark_2_13_2.13 rootjvm_3 rootnative_3
configs-ignore: test scala-tool scala-doc-tool test-internal

build-benchmark:
name: Build and Test Benchmarks
strategy:
matrix:
os: [ubuntu-latest]
java: [temurin@11]
project: [benchmark_2_11, benchmark_2_13, benchmark_3]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (fast)
uses: actions/checkout@v4

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt +update

- name: sbt update (project)
run: sbt 'project ${{ matrix.project }}' update

- name: Test
run: sbt 'project ${{ matrix.project }}' 'Jmh / run TimersBench'

coverage:
name: Generate coverage report
strategy:
Expand Down
26 changes: 26 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ThisBuild / githubWorkflowJavaVersions := Seq(
JavaSpec.temurin("11"),
JavaSpec.temurin("17"),
)
val BenchmarkJavaVersion = JavaSpec.temurin("11")

val circeVersion = "0.14.6"
val scalaTestVersion = "3.2.18"
Expand Down Expand Up @@ -151,6 +152,31 @@ lazy val benchmark_2_11 = (project in file("modules/benchmark_2_11"))
),
)

ThisBuild / githubWorkflowAddedJobs ++= Seq(
WorkflowJob(
id = "build-benchmark",
name = "Build and Test Benchmarks",
javas = List(BenchmarkJavaVersion),
scalas = Nil,
matrixAdds = Map(
"project" -> List(benchmark_2_11.id, benchmark_2_13.id, benchmark_3.id),
),
steps = List(WorkflowStep.Checkout) ++ WorkflowStep.SetupJava(
List(BenchmarkJavaVersion),
) ++ githubWorkflowGeneratedCacheSteps.value ++ List(
WorkflowStep.Run(
name = Some("sbt update (project)"),
commands = List("sbt 'project ${{ matrix.project }}' update"),
),
WorkflowStep.Run(
name = Some("Test"),
commands =
List("sbt 'project ${{ matrix.project }}' 'Jmh / run TimersBench'"),
),
),
),
)

ThisBuild / githubWorkflowTargetBranches := Seq("master")
ThisBuild / tlCiReleaseBranches := Seq() // publish only tags

Expand Down

0 comments on commit 5388724

Please sign in to comment.