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

Update pekko-stream to 1.1.1 #95

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
94b1dc3
Update scala3-library to 3.3.1
scala-steward Sep 12, 2023
e09894c
Regenerate GitHub Actions workflow
scala-steward Sep 12, 2023
1cad1e6
Update scalatest to 3.2.17
scala-steward Sep 12, 2023
b500805
Update sbt-scoverage to 2.0.9
scala-steward Sep 12, 2023
bda5e5a
Update circe-generic, circe-jawn to 0.14.6
scala-steward Sep 7, 2023
394d2f6
Update sbt-github-actions to 0.16.0
scala-steward Sep 7, 2023
fa7ac37
Regenerate GitHub Actions workflow
scala-steward Sep 7, 2023
88fb1e5
Update sbt to 1.9.6
scala-steward Sep 20, 2023
8a3ed49
Update sbt-github-actions to 0.17.0
scala-steward Oct 4, 2023
ff20002
Update scala-library to 2.13.12
scala-steward Oct 4, 2023
d75c673
Update sbt-scalafmt to 2.5.2
scala-steward Oct 4, 2023
2e827d8
Update sbt-github-actions to 0.18.0
scala-steward Oct 18, 2023
40682a0
Update sbt-github-actions to 0.19.0
scala-steward Oct 24, 2023
36fa0cc
Update sbt to 1.9.7
scala-steward Oct 26, 2023
8e9cd03
Update scalafmt
mdedetrich Nov 4, 2023
bf6feac
Update pekko-stream to 1.0.2
scala-steward Dec 1, 2023
7e68f13
Update sbt-sonatype to 3.10.0
scala-steward Nov 17, 2023
06977e4
Update scalafmt
mdedetrich Dec 26, 2023
9b26197
Update scalafmt native github action
mdedetrich Jan 3, 2024
06c44bb
Update sbt to 1.9.8
scala-steward Jan 14, 2024
8e4caec
Update sbt-github-actions to 0.22.0
scala-steward Jan 17, 2024
5fa73f5
Fix typo's, grammar and spelling
mdedetrich Jan 17, 2024
3df401e
Add JDK21 and macos-latest to CI
mdedetrich Jan 23, 2024
c0f1638
Only run inliner in CI
mdedetrich Jan 29, 2024
cce323c
Remove redundant integration test
mdedetrich Feb 4, 2024
9386c48
Update sbt-scoverage to 2.0.10
scala-steward Feb 19, 2024
946894f
Update scalatest to 3.2.18
scala-steward Feb 19, 2024
13ae33c
Update scalafmt-core to 3.8.0
scala-steward Feb 19, 2024
40a3c55
Update pekko-http to 1.0.1
scala-steward Feb 19, 2024
a57edf3
Update sbt-github-actions to 0.23.0
scala-steward Feb 19, 2024
ea66206
Update sbt to 1.9.9
scala-steward Feb 23, 2024
c75b62e
Update sbt-scoverage to 2.0.11
scala-steward Feb 25, 2024
1d17398
Update scala3-library to 3.3.3
scala-steward Mar 2, 2024
7320563
Regenerate GitHub Actions workflow
scala-steward Mar 2, 2024
e9609c9
Update scala-library to 2.13.13
scala-steward Mar 20, 2024
c0df2e4
Regenerate GitHub Actions workflow
scala-steward Mar 20, 2024
b678011
Update scalafmt-core to 3.8.1
scala-steward Mar 30, 2024
1fb5780
Update scala-library to 2.12.19
scala-steward Mar 24, 2024
931d3df
Regenerate GitHub Actions workflow
scala-steward Mar 24, 2024
2a57287
Pin to Scala 3.3.x
mdedetrich Apr 5, 2024
adc3fb4
Use macos-12 instead of macos-latest
mdedetrich May 8, 2024
a33e559
Update sbt to 1.10.0
scala-steward May 13, 2024
8675b7f
Update sbt-scoverage to 2.0.12
scala-steward May 13, 2024
7efc5b1
Update circe-generic, circe-jawn to 0.14.7
scala-steward May 13, 2024
a6c07e0
Add macos-latest to workflow
mdedetrich May 17, 2024
8b3954a
Update scala-library to 2.13.14
scala-steward May 17, 2024
22abeab
Regenerate GitHub Actions workflow
scala-steward May 17, 2024
f24ac18
Update sbt-scoverage to 2.2.0
scala-steward Sep 6, 2024
6bf90d9
Update sbt-sonatype to 3.11.3
scala-steward Aug 21, 2024
7473269
Update jawn-parser to 1.6.0
scala-steward May 31, 2024
591c2c4
Update sbt to 1.10.1
scala-steward Jul 14, 2024
e3cc169
Update pekko-stream to 1.0.3
scala-steward Jun 24, 2024
1da8b76
Update sbt-github-actions to 0.24.0
scala-steward Jun 24, 2024
edfe4d7
Regenerate GitHub Actions workflow
scala-steward Jun 24, 2024
7d27c09
Update scalafmt-core to 3.8.3
scala-steward Jul 29, 2024
fc50953
Update sbt-ci-release to 1.6.1
scala-steward Aug 21, 2024
b5e0444
Update scala-library to 2.12.20
scala-steward Sep 11, 2024
1e058de
Update scalatest to 3.2.19
scala-steward Sep 11, 2024
d83b98a
Update sbt-coveralls to 1.3.13
scala-steward Sep 11, 2024
2030f74
Update circe-generic, circe-jawn to 0.14.10
scala-steward Sep 11, 2024
3c19fcf
Fix .head causing JsonSupport sink to terminate
mdedetrich Sep 12, 2024
1e94eaa
Add sbt-version-policy
mdedetrich Sep 12, 2024
461826c
Update sbt-mima-plugin to 1.1.4
scala-steward Sep 12, 2024
c42610e
Update sbt to 1.10.2
scala-steward Sep 16, 2024
a8825de
Update pekko-stream to 1.1.1
scala-steward Sep 18, 2024
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
83 changes: 56 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,63 @@ jobs:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.18, 2.13.11, 3.3.0]
java: [temurin@8, temurin@11, temurin@17]
os: [ubuntu-latest, macos-12, macos-latest]
scala: [2.12.20, 2.13.14, 3.3.3]
java: [temurin@8, temurin@11, temurin@17, temurin@21]
exclude:
- java: temurin@8
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

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

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

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

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

- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Install sbt
if: matrix.os == 'macos-latest'
run: brew install sbt

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

- name: Report binary compatibility issues
run: sbt '++ ${{ matrix.scala }}' mimaReportBinaryIssues
- name: Report version policy issues
run: sbt '++ ${{ matrix.scala }}' versionPolicyCheck

- name: Build project
run: sbt '++ ${{ matrix.scala }}' clean coverage test
Expand All @@ -75,7 +93,7 @@ jobs:
run: tar cf targets.tar target support/stream-circe/target http-json/target tests/target stream-json/target support/http-circe/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
path: targets.tar
Expand All @@ -87,65 +105,76 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.11]
scala: [2.13.14]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

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

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

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

- name: Download target directories (2.12.18)
uses: actions/download-artifact@v3
- name: Setup Java (temurin@21)
if: matrix.java == 'temurin@21'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: sbt

- name: Setup sbt
uses: sbt/setup-sbt@v1

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

- name: Inflate target directories (2.12.18)
- name: Inflate target directories (2.12.20)
run: |
tar xf targets.tar
rm targets.tar

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

- name: Inflate target directories (2.13.11)
- name: Inflate target directories (2.13.14)
run: |
tar xf targets.tar
rm targets.tar

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

- name: Inflate target directories (3.3.0)
- name: Inflate target directories (3.3.3)
run: |
tar xf targets.tar
rm targets.tar
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Delete artifacts
shell: bash {0}
run: |
# Customize those three lines with your repository and credentials:
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}
Expand All @@ -25,7 +26,7 @@ jobs:
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }

# A temporary file which receives HTTP response headers.
TMPFILE=/tmp/tmp.$$
TMPFILE=$(mktemp)

# An associative array, key: artifact name, value: number of artifacts of that name.
declare -A ARTCOUNT
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
persist-credentials: false

- name: Check project is formatted
uses: jrouly/scalafmt-native-action@v2
uses: jrouly/scalafmt-native-action@v3
with:
version: '3.7.11'
arguments: '--list --mode diff-ref=origin/main'
4 changes: 4 additions & 0 deletions .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
updatePullRequests = "always"

updates.pin = [
{ groupId = "org.scala-lang", artifactId = "scala3-library", version = "3.3." }
]
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.7.11
version = 3.8.3
runner.dialect = scala213
preset = default
align.preset = more
Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Pekko Streams Circe Support

This library provides Json support for stream based applications using [jawn](https://github.com/non/jawn)
as a parser. It supports all backends that jawn supports with support for [circe](https://github.com/travisbrown/circe) provided as a example.
as a parser. It supports all backends that jawn supports with support for [circe](https://github.com/travisbrown/circe) provided as an example.

It is a fork of [akka-streams-json](https://github.com/mdedetrich/akka-streams-json) built with [Apache Pekko](https://pekko.apache.org/).
[akka-streams-json](https://github.com/mdedetrich/akka-streams-json) which is in itself a fork of
Expand Down Expand Up @@ -36,13 +36,13 @@ The parser lives at `org.mdedetrich.pekko.json.stream.JsonStreamParser`
Use one of the constructor methods in the companion object to create the parser at
various levels of abstraction, either a Stage, a Flow, or a Sink.
You just add the [jawn support facade](https://github.com/non/jawn#supporting-external-asts-with-jawn)
of your choice and you will can parsed into their respective Json AST.
of your choice, and you will can parsed into their respective Json AST.


For Http support, either `import org.mdedetrich.pekko.http.JsonSupport._`
or mixin `... with org.mdedetrich.pekko.http.JsonSupport`.

Given an implicit jawn facade, this enable you to decode into the respective Json AST
Given an implicit jawn facade, this enables you to decode into the respective Json AST
using the Pekko HTTP marshalling framework. As jawn is only about parsing and does not abstract
over rendering, you'll only get an Unmarshaller.

Expand All @@ -63,7 +63,7 @@ Adding support for a specific framework is
[easy](support/http-circe/src/main/scala/org/mdedetrich/pekko/http/support/CirceHttpSupport.scala).

These support modules allow you to directly marshall from/unmarshall into your data types
using circes `Decoder` and `Encoder` type classes.
using circe's `Decoder` and `Encoder` type classes.

Just mixin or import `org.mdedetrich.pekko.http.support.CirceHttpSupport` for Http
or pipe your `Source[ByteString, _].via(org.mdedetrich.pekko.stream.CirceStreamSupport.decode[A])`
Expand All @@ -77,11 +77,9 @@ The exception provides Circe cursor history, current cursor and the type hint of

## Why jawn?

Jawn provides a nice interface for asynchronous parsing.
Most other Json marshalling provider will consume the complete entity
at first, convert it to a string and then start to parse.
With jawn, the json is incrementally parsed with each arriving data chunk,
using directly the underlying ByteBuffers without conversion.
Jawn provides a nice interface for asynchronous parsing. Most other Json marshalling provider will consume the complete
entity at first, convert it to a string and then start to parse. With jawn, the json is incrementally parsed with
each arriving data chunk, using directly the underlying ByteBuffers without conversion.

## License

Expand Down
76 changes: 46 additions & 30 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ import com.jsuereth.sbtpgp.PgpKeys.publishSigned

name := "pekko-streams-circe"

val scala213Version = "2.13.11"
val scala212Version = "2.12.18"
val scala3Version = "3.3.0"

val circeVersion = "0.14.5"
val pekkoVersion = "1.0.1"
val pekkoHttpVersion = "1.0.0"
val jawnVersion = "1.5.1"
val scalaTestVersion = "3.2.16"

ThisBuild / crossScalaVersions := Seq(scala212Version, scala213Version, scala3Version)
ThisBuild / scalaVersion := scala213Version
ThisBuild / organization := "org.mdedetrich"
ThisBuild / versionScheme := Some(VersionScheme.EarlySemVer)
val scala213Version = "2.13.14"
val scala212Version = "2.12.20"
val scala3Version = "3.3.3"

val circeVersion = "0.14.10"
val pekkoVersion = "1.1.1"
val pekkoHttpVersion = "1.0.1"
val jawnVersion = "1.6.0"
val scalaTestVersion = "3.2.19"

ThisBuild / crossScalaVersions := Seq(scala212Version, scala213Version, scala3Version)
ThisBuild / scalaVersion := scala213Version
ThisBuild / organization := "org.mdedetrich"
ThisBuild / versionScheme := Some(VersionScheme.EarlySemVer)
ThisBuild / versionPolicyIntention := Compatibility.BinaryCompatible

lazy val streamJson = project
.in(file("stream-json"))
Expand Down Expand Up @@ -98,10 +99,6 @@ ThisBuild / scalacOptions ++= Seq(
"-language:postfixOps"
)

Defaults.itSettings

configs(IntegrationTest)

ThisBuild / homepage := Some(url("https://github.com/mdedetrich/pekko-streams-circe"))

ThisBuild / scmInfo := Some(
Expand Down Expand Up @@ -145,22 +142,24 @@ val flagsFor13 = Seq(
val flagsFor3 = Seq.empty

ThisBuild / scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n == 13 =>
flagsFor13
case Some((2, n)) if n == 12 =>
flagsFor12
case Some((3, _)) =>
Seq.empty
}
if (insideCI.value) {
val log = sLog.value
log.info("Running in CI, enabling Scala2 optimizer")
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n == 13 =>
flagsFor13
case Some((2, n)) if n == 12 =>
flagsFor12
case Some((3, _)) =>
Seq.empty
}
} else Seq.empty
}

IntegrationTest / parallelExecution := false

ThisBuild / githubWorkflowTargetBranches := Seq("main") // Once we have branches per version, add the pattern here

ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(List("mimaReportBinaryIssues"), name = Some("Report binary compatibility issues")),
WorkflowStep.Sbt(List("versionPolicyCheck"), name = Some("Report version policy issues")),
WorkflowStep.Sbt(List("clean", "coverage", "test"), name = Some("Build project"))
)

Expand Down Expand Up @@ -200,8 +199,25 @@ ThisBuild / githubWorkflowPublishTargetBranches :=
RefPredicate.Equals(Ref.Branch("main"))
)

ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest", "macos-12", "macos-latest")

ThisBuild / githubWorkflowJavaVersions := List(
JavaSpec.temurin("8"),
JavaSpec.temurin("11"),
JavaSpec.temurin("17")
JavaSpec.temurin("17"),
JavaSpec.temurin("21")
)

ThisBuild / githubWorkflowBuildMatrixExclusions +=
MatrixExclude(Map("java" -> "temurin@8", "os" -> "macos-latest"))

// GitHub Actions macOS 13+ runner images do not come with sbt preinstalled anymore
ThisBuild / githubWorkflowBuildPreamble ++= Seq(
WorkflowStep.Run(
commands = List(
"brew install sbt"
),
cond = Some("matrix.os == 'macos-latest'"),
name = Some("Install sbt")
)
)
Loading
Loading