Skip to content

Commit

Permalink
Merge branch 'main' into fix-openapi-docgen
Browse files Browse the repository at this point in the history
  • Loading branch information
mobley-trent authored Feb 3, 2025
2 parents c255b83 + 307ca54 commit 2dde2de
Show file tree
Hide file tree
Showing 35 changed files with 525 additions and 496 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @jdegoes @vigoo @adamgfraser @987Nabil
* @jdegoes @vigoo @kyri-petrou @987Nabil
121 changes: 82 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.19, 2.13.14, 3.3.3]
scala: [2.12.20, 2.13.16, 3.3.4]
java:
- graal_graalvm@17
- graal_graalvm@21
Expand Down Expand Up @@ -82,37 +82,31 @@ jobs:
apps: sbt

- name: Check formatting
if: matrix.scala == '2.13.14'
run: sbt ++2.13.14 fmtCheck
if: matrix.scala == '2.13.16'
run: sbt ++2.13.16 fmtCheck

- name: Check that workflows are up to date
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck

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

- uses: coursier/setup-action@v1

- name: Test sbt plugin
if: ${{ github.event_name == 'pull_request' }} && matrix.scala == '2.12.19'
run: sbt ++2.12.19 zioHttpGenSbt/scripted

- uses: coursier/setup-action@v1
with:
apps: sbt

- name: Check doc generation
if: ${{ github.event_name == 'pull_request' }}
run: sbt ++2.13.14 doc
run: sbt ++2.13.16 doc

- name: zio-http-shaded Tests
if: matrix.scala == '2.13.14'
if: matrix.scala == '2.13.16'
env:
PUBLISH_SHADED: true
run: sbt '++ ${{ matrix.scala }}' zioHttpShadedTests/test

- name: Compress target directories
run: tar cf targets.tar sbt-zio-http-grpc/target zio-http-gen-sbt-plugin/target zio-http-cli/target target zio-http/jvm/target zio-http-docs/target sbt-zio-http-grpc-tests/target zio-http-gen/target zio-http-benchmarks/target zio-http-tools/target zio-http-example/target zio-http-testkit/target zio-http/js/target zio-http-htmx/target project/target
run: tar cf targets.tar sbt-zio-http-grpc/target zio-http-cli/target target zio-http/jvm/target zio-http-docs/target sbt-zio-http-grpc-tests/target zio-http-gen/target zio-http-benchmarks/target zio-http-tools/target zio-http-example/target zio-http-testkit/target zio-http/js/target zio-http-htmx/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v4
Expand All @@ -127,7 +121,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [graal_graalvm@17]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -172,36 +166,40 @@ jobs:
java-version: 21
cache: sbt

- name: Download target directories (2.12.19)
- name: Download target directories (2.12.20)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-2.12.19-${{ matrix.java }}
name: target-${{ matrix.os }}-2.12.20-${{ matrix.java }}

- name: Inflate target directories (2.12.19)
- name: Inflate target directories (2.12.20)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.14)
- name: Download target directories (2.13.16)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-2.13.14-${{ matrix.java }}
name: target-${{ matrix.os }}-2.13.16-${{ matrix.java }}

- name: Inflate target directories (2.13.14)
- name: Inflate target directories (2.13.16)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.3.3)
- name: Download target directories (3.3.4)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-3.3.3-${{ matrix.java }}
name: target-${{ matrix.os }}-3.3.4-${{ matrix.java }}

- name: Inflate target directories (3.3.3)
- name: Inflate target directories (3.3.4)
run: |
tar xf targets.tar
rm targets.tar
- uses: coursier/setup-action@v1
with:
apps: sbt

- name: Release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
Expand Down Expand Up @@ -266,7 +264,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -280,7 +278,7 @@ jobs:

- name: Add Scoverage
id: add_plugin
run: sed -i -e '$aaddSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12")' project/plugins.sbt
run: sed -i -e '$aaddSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.3.0")' project/plugins.sbt

- name: Update Build Definition
id: update_build_definition
Expand All @@ -302,7 +300,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -340,7 +338,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -378,7 +376,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -416,7 +414,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -454,7 +452,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -492,7 +490,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -530,7 +528,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -568,7 +566,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -606,7 +604,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -638,13 +636,51 @@ jobs:
name: Jmh_Main_ProbeContentTypeBenchmark
path: Main_ProbeContentTypeBenchmark.txt

Jmh_RoutesBenchmark:
name: Jmh RoutesBenchmark
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- uses: coursier/setup-action@v1
with:
apps: sbt

- uses: actions/checkout@v4
with:
path: zio-http

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11

- name: Benchmark_Main
id: Benchmark_Main
env:
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT}}
run: |
cd zio-http
sed -i -e '$aaddSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")' project/plugins.sbt
cat > Main_RoutesBenchmark.txt
sbt -no-colors -v "zioHttpBenchmarks/jmh:run -i 3 -wi 3 -f1 -t1 RoutesBenchmark" | grep -e "thrpt" -e "avgt" >> ../Main_RoutesBenchmark.txt
- uses: actions/upload-artifact@v4
with:
name: Jmh_Main_RoutesBenchmark
path: Main_RoutesBenchmark.txt

Jmh_SchemeDecodeBenchmark:
name: Jmh SchemeDecodeBenchmark
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -682,7 +718,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -720,7 +756,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -754,7 +790,7 @@ jobs:

Jmh_cache:
name: Cache Jmh benchmarks
needs: [Jmh_CachedDateHeaderBenchmark, Jmh_ClientBenchmark, Jmh_CookieDecodeBenchmark, Jmh_EndpointBenchmark, Jmh_HttpCollectEval, Jmh_HttpCombineEval, Jmh_HttpNestedFlatMapEval, Jmh_HttpRouteTextPerf, Jmh_ProbeContentTypeBenchmark, Jmh_SchemeDecodeBenchmark, Jmh_ServerInboundHandlerBenchmark, Jmh_UtilBenchmark]
needs: [Jmh_CachedDateHeaderBenchmark, Jmh_ClientBenchmark, Jmh_CookieDecodeBenchmark, Jmh_EndpointBenchmark, Jmh_HttpCollectEval, Jmh_HttpCombineEval, Jmh_HttpNestedFlatMapEval, Jmh_HttpRouteTextPerf, Jmh_ProbeContentTypeBenchmark, Jmh_RoutesBenchmark, Jmh_SchemeDecodeBenchmark, Jmh_ServerInboundHandlerBenchmark, Jmh_UtilBenchmark]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
strategy:
matrix:
Expand Down Expand Up @@ -826,6 +862,13 @@ jobs:
- name: Format_Main_ProbeContentTypeBenchmark
run: cat Main_ProbeContentTypeBenchmark.txt >> Main_benchmarks.txt

- uses: actions/download-artifact@v4
with:
name: Jmh_Main_RoutesBenchmark

- name: Format_Main_RoutesBenchmark
run: cat Main_RoutesBenchmark.txt >> Main_benchmarks.txt

- uses: actions/download-artifact@v4
with:
name: Jmh_Main_SchemeDecodeBenchmark
Expand Down Expand Up @@ -872,7 +915,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -951,7 +994,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.14]
scala: [2.13.16]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down
37 changes: 1 addition & 36 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ThisBuild / githubWorkflowAddedJobs :=

ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches += RefPredicate.StartsWith(Ref.Tag("v"))
ThisBuild / githubWorkflowPublishPreamble := Seq(coursierSetup)
ThisBuild / githubWorkflowPublish :=
Seq(
WorkflowStep.Sbt(
Expand Down Expand Up @@ -93,22 +94,6 @@ ThisBuild / githubWorkflowBuildPreamble := Seq(
),
)

ThisBuild / githubWorkflowBuild := {
(ThisBuild / githubWorkflowBuild).value ++ WorkflowJob(
"testSbtPlugin",
"Test sbt plugin",
List(
WorkflowStep.Use(UseRef.Public("coursier", "setup-action", "v1")),
WorkflowStep.Run(
name = Some(s"Test sbt plugin"),
commands = List(s"sbt ++${Scala212} zioHttpGenSbt/scripted"),
cond = Some(s"$${{ github.event_name == 'pull_request' }} && matrix.scala == '$Scala212'"),
),
),
scalas = List(Scala212),
).steps
}

ThisBuild / githubWorkflowBuildPostamble :=
WorkflowJob(
"checkDocGeneration",
Expand Down Expand Up @@ -366,26 +351,6 @@ lazy val zioHttpGen = (project in file("zio-http-gen"))
)
.dependsOn(zioHttpJVM)

lazy val zioHttpGenSbt = (project in file("zio-http-gen-sbt-plugin"))
.enablePlugins(SbtPlugin)
.settings(publishSetting(true))
.settings(
name := "zio-http-sbt-codegen",
sbtPlugin := true,
scalaVersion := Scala212,
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
scalacOptions ++= stdOptions ++ extraOptions(scalaVersion.value),
sbtTestDirectory := sourceDirectory.value / "sbt-test",
scriptedLaunchOpts += ("-Dplugin.version=" + version.value),
scriptedBufferLog := false,
libraryDependencies ++= Seq(
`zio-json-yaml`,
`zio-test`,
`zio-test-sbt`,
)
).dependsOn(LocalProject("zioHttpGen"))

lazy val sbtZioHttpGrpc = (project in file("sbt-zio-http-grpc"))
.settings(stdSettings("sbt-zio-http-grpc"))
.settings(publishSetting(true))
Expand Down
Loading

0 comments on commit 2dde2de

Please sign in to comment.