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

Add Dotty support for FS2 2.x #1973

Merged
merged 14 commits into from Jul 29, 2020
56 changes: 40 additions & 16 deletions .github/workflows/ci.yml
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.2, 2.12.10]
scala: [2.13.2, 2.12.10, 0.26.0-RC1]
java: [adopt@1.11]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -106,12 +106,6 @@ jobs:
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}-core_js_target
path: core/js/target

- name: Upload target directory 'site/target' (${{ matrix.scala }})
uses: actions/upload-artifact@v1
with:
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}-site_target
path: site/target

- name: Upload target directory 'core/jvm/target' (${{ matrix.scala }})
uses: actions/upload-artifact@v1
with:
Expand Down Expand Up @@ -212,6 +206,12 @@ jobs:
name: target-${{ matrix.os }}-2.12.10-${{ matrix.java }}-experimental_target
path: experimental/target

- name: Download target directory 'experimental/target' (0.26.0-RC1)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-0.26.0-RC1-${{ matrix.java }}-experimental_target
path: experimental/target

- name: Download target directory 'target' (2.13.2)
uses: actions/download-artifact@v1
with:
Expand All @@ -224,6 +224,12 @@ jobs:
name: target-${{ matrix.os }}-2.12.10-${{ matrix.java }}-target
path: target

- name: Download target directory 'target' (0.26.0-RC1)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-0.26.0-RC1-${{ matrix.java }}-target
path: target

- name: Download target directory 'core/js/target' (2.13.2)
uses: actions/download-artifact@v1
with:
Expand All @@ -236,17 +242,11 @@ jobs:
name: target-${{ matrix.os }}-2.12.10-${{ matrix.java }}-core_js_target
path: core/js/target

- name: Download target directory 'site/target' (2.13.2)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-2.13.2-${{ matrix.java }}-site_target
path: site/target

- name: Download target directory 'site/target' (2.12.10)
- name: Download target directory 'core/js/target' (0.26.0-RC1)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-2.12.10-${{ matrix.java }}-site_target
path: site/target
name: target-${{ matrix.os }}-0.26.0-RC1-${{ matrix.java }}-core_js_target
path: core/js/target

- name: Download target directory 'core/jvm/target' (2.13.2)
uses: actions/download-artifact@v1
Expand All @@ -260,6 +260,12 @@ jobs:
name: target-${{ matrix.os }}-2.12.10-${{ matrix.java }}-core_jvm_target
path: core/jvm/target

- name: Download target directory 'core/jvm/target' (0.26.0-RC1)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-0.26.0-RC1-${{ matrix.java }}-core_jvm_target
path: core/jvm/target

- name: Download target directory 'io/target' (2.13.2)
uses: actions/download-artifact@v1
with:
Expand All @@ -272,6 +278,12 @@ jobs:
name: target-${{ matrix.os }}-2.12.10-${{ matrix.java }}-io_target
path: io/target

- name: Download target directory 'io/target' (0.26.0-RC1)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-0.26.0-RC1-${{ matrix.java }}-io_target
path: io/target

- name: Download target directory 'reactive-streams/target' (2.13.2)
uses: actions/download-artifact@v1
with:
Expand All @@ -284,6 +296,12 @@ jobs:
name: target-${{ matrix.os }}-2.12.10-${{ matrix.java }}-reactive-streams_target
path: reactive-streams/target

- name: Download target directory 'reactive-streams/target' (0.26.0-RC1)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-0.26.0-RC1-${{ matrix.java }}-reactive-streams_target
path: reactive-streams/target

- name: Download target directory 'benchmark/target' (2.13.2)
uses: actions/download-artifact@v1
with:
Expand All @@ -296,6 +314,12 @@ jobs:
name: target-${{ matrix.os }}-2.12.10-${{ matrix.java }}-benchmark_target
path: benchmark/target

- name: Download target directory 'benchmark/target' (0.26.0-RC1)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-0.26.0-RC1-${{ matrix.java }}-benchmark_target
path: benchmark/target

- name: Download target directory 'project/target'
uses: actions/download-artifact@v1
with:
Expand Down
87 changes: 0 additions & 87 deletions benchmark/src/main/scala/fs2/benchmark/CompressBenchmark.scala

This file was deleted.

8 changes: 5 additions & 3 deletions benchmark/src/main/scala/fs2/benchmark/PullBenchmark.scala
Expand Up @@ -10,18 +10,20 @@ class PullBenchmark {
var n: Int = _

@Benchmark
def unconsPull(): Int =
(Stream
.chunk(Chunk.seq(0 to 2560)))
def unconsPull(): Int = {
val s: Stream[Pure, Int] = Stream
.chunk(Chunk.seq(0 to 2560))
.repeatPull { s =>
s.unconsN(n).flatMap {
case Some((h, t)) => Pull.output(h).as(Some(t))
case None => Pull.pure(None)
}
}
s
.covary[IO]
.compile
.last
.unsafeRunSync
.get
}
}
6 changes: 3 additions & 3 deletions benchmark/src/main/scala/fs2/benchmark/QueueBenchmark.scala
@@ -1,16 +1,16 @@
package fs2.benchmark

import cats.syntax.all._
import cats.effect.{Concurrent, IO}
import cats.effect.{Concurrent, ContextShift, IO}
import fs2._
import fs2.concurrent.Queue
import org.openjdk.jmh.annotations.{Benchmark, Param, Scope, State}

import scala.concurrent.ExecutionContext
@State(Scope.Thread)
class QueueBenchmark {
implicit val cs = IO.contextShift(ExecutionContext.global)
implicit val concurrent = IO.ioConcurrentEffect
implicit val cs: ContextShift[IO] = IO.contextShift(ExecutionContext.global)
implicit val concurrent: Concurrent[IO] = IO.ioConcurrentEffect

val size = 100000

Expand Down