Skip to content

Commit

Permalink
Merge pull request #396 from circe/pr/native
Browse files Browse the repository at this point in the history
Scala Native
  • Loading branch information
armanbilge committed Nov 11, 2022
2 parents 03ab1a7 + 8d2af2b commit cdddbf3
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
42 changes: 39 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -30,14 +30,16 @@ jobs:
os: [ubuntu-latest]
scala: [2.12.17, 2.13.10, 3.2.1]
java: [temurin@11, temurin@17]
project: [rootJS, rootJVM]
project: [rootJS, rootJVM, rootNative]
exclude:
- scala: 2.12.17
java: temurin@17
- scala: 3.2.1
java: temurin@17
- project: rootJS
java: temurin@17
- project: rootNative
java: temurin@17
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand Down Expand Up @@ -100,6 +102,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 @@ -117,11 +123,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 .jvm/target .native/target fs2/.js/target fs2/.jvm/target project/target
run: mkdir -p fs2/.native/target target .js/target .jvm/target .native/target fs2/.js/target fs2/.jvm/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 .jvm/target .native/target fs2/.js/target fs2/.jvm/target project/target
run: tar cf targets.tar fs2/.native/target target .js/target .jvm/target .native/target fs2/.js/target fs2/.jvm/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
Expand Down Expand Up @@ -210,6 +216,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.10, rootJS)
uses: actions/download-artifact@v2
with:
Expand All @@ -230,6 +246,16 @@ jobs:
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.10, rootNative)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.10-rootNative

- name: Inflate target directories (2.13.10, rootNative)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.2.1, rootJS)
uses: actions/download-artifact@v2
with:
Expand All @@ -250,6 +276,16 @@ jobs:
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.2.1, rootNative)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.1-rootNative

- name: Inflate target directories (3.2.1, 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
8 changes: 5 additions & 3 deletions build.sbt
Expand Up @@ -3,14 +3,16 @@ ThisBuild / circeRootOfCodeCoverage := None
ThisBuild / startYear := Some(2017)
ThisBuild / scalafixScalaBinaryVersion := "2.12"

ThisBuild / resolvers ++= Resolver.sonatypeOssRepos("snapshots")

val circeVersion = "0.14.3"
val fs2Version = "3.3.0"
val jawnVersion = "1.4.0"
val previousCirceFs2Version = "0.13.0"

val scalaTestVersion = "3.2.14"
val scalaTestPlusVersion = "3.2.14.0"
val catsEffectTestingVersion = "1.4.0"
val catsEffectTestingVersion = "1.5-852166f-SNAPSHOT"
val scalacheckEffectVersion = "2.0.0-M2"

val scala212 = "2.12.17"
Expand All @@ -21,7 +23,7 @@ ThisBuild / crossScalaVersions := Seq(scala212, scala213, "3.2.1")

lazy val root = tlCrossRootProject.aggregate(fs2)

lazy val fs2 = crossProject(JVMPlatform, JSPlatform)
lazy val fs2 = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("fs2"))
.settings(
Expand All @@ -38,6 +40,6 @@ lazy val fs2 = crossProject(JVMPlatform, JSPlatform)
"org.typelevel" %%% "jawn-parser" % jawnVersion
)
)
.jsSettings(
.platformsSettings(JSPlatform, NativePlatform)(
tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.14.1").toMap
)
2 changes: 2 additions & 0 deletions project/plugins.sbt
@@ -1,2 +1,4 @@
addSbtPlugin("io.circe" % "sbt-circe-org" % "0.1.0")
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")

0 comments on commit cdddbf3

Please sign in to comment.