Skip to content

Commit

Permalink
Add jdk17 build (#235)
Browse files Browse the repository at this point in the history
- Add JDK17 actions
- Split actions into 1 per lang/jdk version
  • Loading branch information
stephenamar-db authored Dec 12, 2024
1 parent a5c3bc2 commit 5149b6e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,28 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
lang: ['jvm', 'js', 'native']
java: ['11', '17']
env:
# Set LANG=C to simulate least-common-denominator target deployment environments:
LANG: C

name: Sjsonnet build for ${{ matrix.lang }} on JDK ${{ matrix.java }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Run mill tests
run: ./mill __.test
java-version: ${{ matrix.java }}
distribution: 'zulu'
- name: Run mill tests for ${{ matrix.lang }}
run: ./mill _.${{ matrix.lang }}[_].test
- name: Compile with sbt
if: ${{ matrix.lang == 'jvm' }}
run: sbt compile bench/compile bench/jmh:compile
- name: Run sbt tests
if: ${{ matrix.lang == 'jvm' }}
run: sbt test
12 changes: 10 additions & 2 deletions sjsonnet/test/src-jvm/sjsonnet/StdGzipTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ import utest._
object StdGzipTests extends TestSuite {
val tests = Tests {
test("gzip"){
eval("""std.gzip([1, 2])""") ==> ujson.Str("H4sIAAAAAAAAAGNkAgCSQsy2AgAAAA==")
eval("""std.gzip("hi")""") ==> ujson.Str("H4sIAAAAAAAAAMvIBACsKpPYAgAAAA==")
eval("""std.gzip([1, 2])""") ==> ujson.Str(Runtime.version().feature() match {
// https://bugs.openjdk.org/browse/JDK-8244706
case s if s >= 16 => "H4sIAAAAAAAA/2NkAgCSQsy2AgAAAA=="
case _ => "H4sIAAAAAAAAAGNkAgCSQsy2AgAAAA=="
})
eval("""std.gzip("hi")""") ==> ujson.Str(Runtime.version().feature() match {
// https://bugs.openjdk.org/browse/JDK-8244706
case s if s >= 16 => "H4sIAAAAAAAA/8vIBACsKpPYAgAAAA=="
case _ => "H4sIAAAAAAAAAMvIBACsKpPYAgAAAA=="
})
}
}
}
Expand Down

0 comments on commit 5149b6e

Please sign in to comment.