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

Cross-build for Native #377

Merged
merged 1 commit into from
Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 37 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand All @@ -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')
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down
17 changes: 10 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -30,31 +30,33 @@ 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(
name := "cats-effect-testing-scalatest",

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(
Expand All @@ -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"))
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")