From 9366e442381c80e9279305731c31ecd6718aebd7 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 9 Sep 2022 21:12:01 +0000 Subject: [PATCH 1/2] Cross-build for Native --- .github/workflows/ci.yml | 40 +++++++++++++++++++++++++++++++++++++--- build.sbt | 6 +++--- project/plugins.sbt | 2 ++ 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67b67fd..694d8c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: os: [ubuntu-latest] scala: [3.1.3, 2.12.16, 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/main') - run: mkdir -p target .js/target munit/jvm/target core/js/target core/jvm/target .jvm/target .native/target munit/js/target project/target + run: mkdir -p target .js/target munit/jvm/target core/native/target core/js/target munit/native/target core/jvm/target .jvm/target .native/target munit/js/target project/target - name: Compress target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - run: tar cf targets.tar target .js/target munit/jvm/target core/js/target core/jvm/target .jvm/target .native/target munit/js/target project/target + run: tar cf targets.tar target .js/target munit/jvm/target core/native/target core/js/target munit/native/target core/jvm/target .jvm/target .native/target munit/js/target project/target - name: Upload target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') @@ -167,6 +171,16 @@ jobs: tar xf targets.tar rm targets.tar + - name: Download target directories (3.1.3, rootNative) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootNative + + - name: Inflate target directories (3.1.3, rootNative) + run: | + tar xf targets.tar + rm targets.tar + - name: Download target directories (2.12.16, 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.16, rootNative) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootNative + + - name: Inflate target directories (2.12.16, 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 bf89676..8be4a7d 100644 --- a/build.sbt +++ b/build.sbt @@ -8,7 +8,7 @@ ThisBuild / tlVersionIntroduced := Map("3" -> "1.0.2") lazy val root = tlCrossRootProject.aggregate(core, munit) -lazy val core = crossProject(JSPlatform, JVMPlatform) +lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings( name := "scalacheck-effect", tlFatalWarnings := false @@ -20,7 +20,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform) ) ) -lazy val munit = crossProject(JSPlatform, JVMPlatform) +lazy val munit = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings( name := "scalacheck-effect-munit", testFrameworks += new TestFramework("munit.Framework") @@ -29,6 +29,6 @@ lazy val munit = crossProject(JSPlatform, JVMPlatform) .settings( libraryDependencies ++= List( "org.scalameta" %%% "munit-scalacheck" % "1.0.0-M6", - "org.typelevel" %%% "cats-effect" % "3.3.14" % Test + "org.typelevel" %%% "cats-effect" % "3.3.14-1-5d11fe9" % Test ) ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 79fddf6..3ae8205 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,4 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1") addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.13") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7") +addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0") From f6afe45009581ab63808b8133c04a29a4ebbfd42 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Wed, 14 Sep 2022 16:12:33 -0700 Subject: [PATCH 2/2] Rollback to 3.3.14 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 8be4a7d..bbf36d3 100644 --- a/build.sbt +++ b/build.sbt @@ -29,6 +29,6 @@ lazy val munit = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings( libraryDependencies ++= List( "org.scalameta" %%% "munit-scalacheck" % "1.0.0-M6", - "org.typelevel" %%% "cats-effect" % "3.3.14-1-5d11fe9" % Test + "org.typelevel" %%% "cats-effect" % "3.3.14" % Test ) )