Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into stacksafety
Browse files Browse the repository at this point in the history
  • Loading branch information
vigoo committed Nov 6, 2022
2 parents 661d0c4 + 4cebfd1 commit e3d0095
Show file tree
Hide file tree
Showing 63 changed files with 3,593 additions and 8,238 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
scala: ['2.12.17', '2.13.8', '3.1.1']
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v13
with:
java-version: ${{ matrix.java }}
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This file was autogenerated using `zio-sbt` via `sbt generateGithubWorkflow`
# task and should be included in the git repository. Please do not edit
# it manually.

name: Documentation

on:
release:
types: [created]

jobs:
publish-docs:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Print Latest Tag For Debugging Purposes
run: git tag --sort=committerdate | tail -1
- uses: olafurpg/setup-scala@v13
- name: Compile Project's Documentation
run: sbt compileDocs
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Publishing Docs to NPM Registry
run: sbt publishToNpm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 0 additions & 18 deletions .github/workflows/mdoc.yml

This file was deleted.

22 changes: 8 additions & 14 deletions benchmarks/src/main/scala/zio/schema/codec/CodecBenchmarks.scala
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
package zio.schema.codec

import zio.{BootstrapRuntime, Chunk}
import zio.internal.{Platform, Tracing}
import zio.schema.{DeriveSchema, Schema}
import zio.Chunk
import zio.schema.{ DeriveSchema, Schema }

object CodecBenchmarks {

val TracedRuntime: BootstrapRuntime = new BootstrapRuntime {
override val platform = Platform.benchmark.withTracing(Tracing.enabled)
}

sealed trait Status
case class Ok(response: List[String]) extends Status
case class Failed(code: Int, reason: String, additionalExplanation: Option[String])
extends Status
case object Pending extends Status
case class Ok(response: List[String]) extends Status
case class Failed(code: Int, reason: String, additionalExplanation: Option[String]) extends Status
case object Pending extends Status

val statusSchema: Schema[Status] = DeriveSchema.gen[Status]
val statusProtobufEncoder: Status => Chunk[Byte] = ProtobufCodec.encode(statusSchema)
val statusProtobufDecoder: Chunk[Byte] => Either[String,Status] = ProtobufCodec.decode(statusSchema)
val statusSchema: Schema[Status] = DeriveSchema.gen[Status]
val statusProtobufEncoder: Status => Chunk[Byte] = ProtobufCodec.encode(statusSchema)
val statusProtobufDecoder: Chunk[Byte] => Either[String, Status] = ProtobufCodec.decode(statusSchema)

val statuses: Array[Status] = Array(
Ok(List.fill(20)("value")),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package zio.schema.codec

import org.openjdk.jmh.annotations._
import zio.internal.{Platform, Tracing}
import zio.{BootstrapRuntime, Chunk}
import zio.schema.{DeriveSchema, Schema}
import zio.stream.{ZSink, ZStream}

import java.util.concurrent.TimeUnit

Expand All @@ -18,19 +14,14 @@ import java.util.concurrent.TimeUnit
class ProtobufBenchmarks {
import CodecBenchmarks._

val TracedRuntime: BootstrapRuntime = new BootstrapRuntime {
override val platform = Platform.benchmark.withTracing(Tracing.enabled)
}

@Param(Array("1000"))
var size: Int = _

var outputs: Array[Any] = _

@Setup
def allocateOutputs(): Unit = {
def allocateOutputs(): Unit =
outputs = Array.ofDim[Any](size)
}

@Benchmark
def enumEncoding(): Array[Any] = {
Expand Down
53 changes: 25 additions & 28 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ lazy val root = project
zioSchemaThriftJS,
zioSchemaThriftJVM,
zioSchemaAvroJS,
zioSchemaAvroJVM
zioSchemaAvroJVM,
zioSchemaMsgPackJS,
zioSchemaMsgPackJVM
)
.enablePlugins(WebsitePlugin)

lazy val tests = crossProject(JSPlatform, JVMPlatform)
.in(file("tests"))
Expand Down Expand Up @@ -195,6 +198,26 @@ lazy val zioSchemaThriftJS = zioSchemaThrift.js

lazy val zioSchemaThriftJVM = zioSchemaThrift.jvm

lazy val zioSchemaMsgPack = crossProject(JSPlatform, JVMPlatform)
.in(file("zio-schema-msg-pack"))
.dependsOn(zioSchema, zioSchemaDerivation, tests % "test->test")
.settings(stdSettings("zio-schema-msg-pack"))
.settings(dottySettings)
.settings(crossProjectSettings)
.settings(buildInfoSettings("zio.schema.msgpack"))
.settings(
libraryDependencies ++= Seq(
"org.msgpack" % "msgpack-core" % "0.9.3",
"org.msgpack" % "jackson-dataformat-msgpack" % "0.9.3" % Test,
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.13.2" % Test
)
)

lazy val zioSchemaMsgPackJS = zioSchemaMsgPack.js
.settings(scalaJSUseMainModuleInitializer := true)

lazy val zioSchemaMsgPackJVM = zioSchemaMsgPack.jvm

lazy val zioSchemaAvro = crossProject(JSPlatform, JVMPlatform)
.in(file("zio-schema-avro"))
.dependsOn(zioSchema, zioSchemaDerivation, tests % "test->test")
Expand Down Expand Up @@ -265,33 +288,7 @@ lazy val zioSchemaZioTestJS = zioSchemaZioTest.js

lazy val zioSchemaZioTestJVM = zioSchemaZioTest.jvm

lazy val docs = project
.in(file("zio-schema-docs"))
.settings(
publish / skip := true,
mdocVariables := Map(
"SNAPSHOT_VERSION" -> version.value,
"RELEASE_VERSION" -> previousStableVersion.value.getOrElse("can't find release"),
"ORG" -> organization.value,
"NAME" -> (zioSchemaJVM / name).value,
"CROSS_VERSIONS" -> (zioSchemaJVM / crossScalaVersions).value.mkString(", ")
),
moduleName := "zio-schema-docs",
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings",
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion
),
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(root),
ScalaUnidoc / unidoc / target := (LocalRootProject / baseDirectory).value / "website" / "static" / "api",
cleanFiles += (ScalaUnidoc / unidoc / target).value,
docusaurusCreateSite := docusaurusCreateSite.dependsOn(Compile / unidoc).value,
docusaurusPublishGhpages := docusaurusPublishGhpages.dependsOn(Compile / unidoc).value
)
.dependsOn(root)
.enablePlugins(MdocPlugin, DocusaurusPlugin, ScalaUnidocPlugin)

lazy val benchmarks = project
.in(file("benchmarks"))
.dependsOn(zioSchemaJVM)
.dependsOn(zioSchemaJVM, zioSchemaDerivationJVM, zioSchemaProtobufJVM)
.enablePlugins(JmhPlugin)
45 changes: 0 additions & 45 deletions docs/about/code_of_conduct.md

This file was deleted.

Loading

0 comments on commit e3d0095

Please sign in to comment.