Skip to content

Commit 49102aa

Browse files
authored
Merge pull request #218 from armanbilge/feature/native
Cross-build for Native
2 parents 66e864e + f6afe45 commit 49102aa

3 files changed

Lines changed: 41 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
os: [ubuntu-latest]
3131
scala: [3.1.3, 2.12.16, 2.13.8]
3232
java: [temurin@8]
33-
project: [rootJS, rootJVM]
33+
project: [rootJS, rootJVM, rootNative]
3434
runs-on: ${{ matrix.os }}
3535
steps:
3636
- name: Checkout current branch (full)
@@ -77,6 +77,10 @@ jobs:
7777
if: matrix.project == 'rootJS'
7878
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/scalaJSLinkerResult
7979

80+
- name: nativeLink
81+
if: matrix.project == 'rootNative'
82+
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/nativeLink
83+
8084
- name: Test
8185
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test
8286

@@ -90,11 +94,11 @@ jobs:
9094

9195
- name: Make target directories
9296
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
93-
run: mkdir -p target .js/target munit/jvm/target core/js/target core/jvm/target .jvm/target .native/target munit/js/target project/target
97+
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
9498

9599
- name: Compress target directories
96100
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
97-
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
101+
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
98102

99103
- name: Upload target directories
100104
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
@@ -167,6 +171,16 @@ jobs:
167171
tar xf targets.tar
168172
rm targets.tar
169173
174+
- name: Download target directories (3.1.3, rootNative)
175+
uses: actions/download-artifact@v2
176+
with:
177+
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootNative
178+
179+
- name: Inflate target directories (3.1.3, rootNative)
180+
run: |
181+
tar xf targets.tar
182+
rm targets.tar
183+
170184
- name: Download target directories (2.12.16, rootJS)
171185
uses: actions/download-artifact@v2
172186
with:
@@ -187,6 +201,16 @@ jobs:
187201
tar xf targets.tar
188202
rm targets.tar
189203
204+
- name: Download target directories (2.12.16, rootNative)
205+
uses: actions/download-artifact@v2
206+
with:
207+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootNative
208+
209+
- name: Inflate target directories (2.12.16, rootNative)
210+
run: |
211+
tar xf targets.tar
212+
rm targets.tar
213+
190214
- name: Download target directories (2.13.8, rootJS)
191215
uses: actions/download-artifact@v2
192216
with:
@@ -207,6 +231,16 @@ jobs:
207231
tar xf targets.tar
208232
rm targets.tar
209233
234+
- name: Download target directories (2.13.8, rootNative)
235+
uses: actions/download-artifact@v2
236+
with:
237+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootNative
238+
239+
- name: Inflate target directories (2.13.8, rootNative)
240+
run: |
241+
tar xf targets.tar
242+
rm targets.tar
243+
210244
- name: Import signing key
211245
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
212246
run: echo $PGP_SECRET | base64 -di | gpg --import

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ThisBuild / tlVersionIntroduced := Map("3" -> "1.0.2")
88

99
lazy val root = tlCrossRootProject.aggregate(core, munit)
1010

11-
lazy val core = crossProject(JSPlatform, JVMPlatform)
11+
lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
1212
.settings(
1313
name := "scalacheck-effect",
1414
tlFatalWarnings := false
@@ -20,7 +20,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
2020
)
2121
)
2222

23-
lazy val munit = crossProject(JSPlatform, JVMPlatform)
23+
lazy val munit = crossProject(JSPlatform, JVMPlatform, NativePlatform)
2424
.settings(
2525
name := "scalacheck-effect-munit",
2626
testFrameworks += new TestFramework("munit.Framework")

project/plugins.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1")
22
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.13")
3+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7")
4+
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")

0 commit comments

Comments
 (0)