Skip to content

Commit

Permalink
Add build for scala-native 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
hamnis committed Sep 24, 2024
1 parent 03f271a commit 83fd34e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ jobs:
os: [ubuntu-latest]
scala: [2.13, 3]
java: [temurin@11, temurin@17]
project: [rootJS, rootJVM]
project: [rootJS, rootJVM, rootNative]
exclude:
- scala: 3
java: temurin@17
- project: rootJS
java: temurin@17
- project: rootNative
java: temurin@17
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
Expand Down Expand Up @@ -89,6 +91,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 @@ -102,11 +108,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 optics/.jvm/target optics/.js/target project/target
run: mkdir -p optics/.native/target optics/.jvm/target optics/.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 optics/.jvm/target optics/.js/target project/target
run: tar cf targets.tar optics/.native/target optics/.jvm/target optics/.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')
Expand Down Expand Up @@ -180,6 +186,16 @@ jobs:
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13, rootNative)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative

- name: Inflate target directories (2.13, rootNative)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3, rootJS)
uses: actions/download-artifact@v4
with:
Expand All @@ -200,6 +216,16 @@ jobs:
tar xf targets.tar
rm targets.tar
- name: Download target directories (3, rootNative)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootNative

- name: Inflate target directories (3, rootNative)
run: |
tar xf targets.tar
rm targets.tar
- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
env:
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ val semVerRegex = """(\d+\.\d+\.)(\d+)(?:-SNAPSHOT)?""".r

lazy val root = tlCrossRootProject.aggregate(optics)

lazy val optics = crossProject(JVMPlatform, JSPlatform)
lazy val optics = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("optics"))
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
addSbtPlugin("io.circe" % "sbt-circe-org" % "0.4.2")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.5")

0 comments on commit 83fd34e

Please sign in to comment.