diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03522e5..e301af6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: os: [ubuntu-latest] scala: [3.2.0, 2.12.17, 2.13.8] java: [temurin@8] - project: [rootJS, rootJVM] + project: [rootJS, rootJVM, rootNative] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -77,6 +77,10 @@ jobs: if: matrix.project == 'rootJS' run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/scalaJSLinkerResult + - name: nativeLink + if: matrix.project == 'rootNative' + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/nativeLink + - name: Test run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test @@ -90,11 +94,11 @@ jobs: - name: Make target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/1.x') - run: mkdir -p specs2/js/target target .js/target minitest/jvm/target minitest/js/target utest/js/target core/js/target core/jvm/target specs2/jvm/target .jvm/target .native/target utest/jvm/target scalatest/js/target scalatest/jvm/target project/target + run: mkdir -p specs2/js/target target .js/target minitest/jvm/target minitest/js/target utest/native/target core/native/target utest/js/target core/js/target core/jvm/target specs2/jvm/target .jvm/target .native/target scalatest/native/target utest/jvm/target scalatest/js/target scalatest/jvm/target specs2/native/target project/target - name: Compress target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/1.x') - run: tar cf targets.tar specs2/js/target target .js/target minitest/jvm/target minitest/js/target utest/js/target core/js/target core/jvm/target specs2/jvm/target .jvm/target .native/target utest/jvm/target scalatest/js/target scalatest/jvm/target project/target + run: tar cf targets.tar specs2/js/target target .js/target minitest/jvm/target minitest/js/target utest/native/target core/native/target utest/js/target core/js/target core/jvm/target specs2/jvm/target .jvm/target .native/target scalatest/native/target utest/jvm/target scalatest/js/target scalatest/jvm/target specs2/native/target project/target - name: Upload target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/1.x') @@ -167,6 +171,16 @@ jobs: tar xf targets.tar rm targets.tar + - name: Download target directories (3.2.0, rootNative) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.0-rootNative + + - name: Inflate target directories (3.2.0, rootNative) + run: | + tar xf targets.tar + rm targets.tar + - name: Download target directories (2.12.17, rootJS) uses: actions/download-artifact@v2 with: @@ -187,6 +201,16 @@ jobs: tar xf targets.tar rm targets.tar + - name: Download target directories (2.12.17, rootNative) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootNative + + - name: Inflate target directories (2.12.17, rootNative) + run: | + tar xf targets.tar + rm targets.tar + - name: Download target directories (2.13.8, rootJS) uses: actions/download-artifact@v2 with: @@ -207,6 +231,16 @@ jobs: tar xf targets.tar rm targets.tar + - name: Download target directories (2.13.8, rootNative) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootNative + + - name: Inflate target directories (2.13.8, rootNative) + run: | + tar xf targets.tar + rm targets.tar + - name: Import signing key if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' run: echo $PGP_SECRET | base64 -di | gpg --import diff --git a/build.sbt b/build.sbt index b9f4a37..bb439c3 100644 --- a/build.sbt +++ b/build.sbt @@ -16,7 +16,7 @@ name := "cats-effect-testing" -ThisBuild / tlBaseVersion := "1.4" +ThisBuild / tlBaseVersion := "1.5" ThisBuild / startYear := Some(2020) ThisBuild / developers += tlGitHubDev("djspiewak", "Daniel Spiewak") @@ -30,22 +30,23 @@ val CatsEffectVersion = "3.3.14" lazy val root = tlCrossRootProject .aggregate(core, specs2, utest, minitest, scalatest) -lazy val core = crossProject(JSPlatform, JVMPlatform) +lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("core")) .settings( name := "cats-effect-testing-core", tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "1.3.0").toMap, libraryDependencies += "org.typelevel" %%% "cats-effect" % CatsEffectVersion) + .nativeSettings(tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "1.5.0").toMap) -lazy val specs2 = crossProject(JSPlatform, JVMPlatform) +lazy val specs2 = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("specs2")) .dependsOn(core) .settings( name := "cats-effect-testing-specs2", - libraryDependencies += ("org.specs2" %%% "specs2-core" % "4.17.0") - .exclude("org.scala-js", "scala-js-macrotask-executor_sjs1_2.13")) + libraryDependencies += "org.specs2" %%% "specs2-core" % "4.17.0") + .nativeSettings(tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "1.5.0").toMap) -lazy val scalatest = crossProject(JSPlatform, JVMPlatform) +lazy val scalatest = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("scalatest")) .dependsOn(core) .settings( @@ -53,8 +54,9 @@ lazy val scalatest = crossProject(JSPlatform, JVMPlatform) libraryDependencies ++= Seq( "org.scalatest" %%% "scalatest" % "3.2.14")) + .nativeSettings(tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "1.5.0").toMap) -lazy val utest = crossProject(JSPlatform, JVMPlatform) +lazy val utest = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("utest")) .dependsOn(core) .settings( @@ -67,6 +69,7 @@ lazy val utest = crossProject(JSPlatform, JVMPlatform) "com.lihaoyi" %%% "utest" % "0.8.1"), Test / scalacOptions -= "-Xfatal-warnings") + .nativeSettings(tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "1.5.0").toMap) lazy val minitest = crossProject(JSPlatform, JVMPlatform) .in(file("minitest")) diff --git a/core/js/src/main/scala/cats/effect/testing/RuntimePlatform.scala b/core/js-native/src/main/scala/cats/effect/testing/RuntimePlatform.scala similarity index 100% rename from core/js/src/main/scala/cats/effect/testing/RuntimePlatform.scala rename to core/js-native/src/main/scala/cats/effect/testing/RuntimePlatform.scala diff --git a/project/plugins.sbt b/project/plugins.sbt index c6a389a..82fb0cf 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,4 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.16") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7") +addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0") diff --git a/scalatest/js/src/main/scala/cats/effect/testing/scalatest/AsyncIOSpec.scala b/scalatest/js-native/src/main/scala/cats/effect/testing/scalatest/AsyncIOSpec.scala similarity index 100% rename from scalatest/js/src/main/scala/cats/effect/testing/scalatest/AsyncIOSpec.scala rename to scalatest/js-native/src/main/scala/cats/effect/testing/scalatest/AsyncIOSpec.scala diff --git a/specs2/js/src/test/scala/cats/effect/testing/specs2/CatsEffectSpecsPlatform.scala b/specs2/js-native/src/test/scala/cats/effect/testing/specs2/CatsEffectSpecsPlatform.scala similarity index 100% rename from specs2/js/src/test/scala/cats/effect/testing/specs2/CatsEffectSpecsPlatform.scala rename to specs2/js-native/src/test/scala/cats/effect/testing/specs2/CatsEffectSpecsPlatform.scala