diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index e250bf7f..b5d9bd17 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -5,20 +5,56 @@ on: branches: [ master ] jobs: - build: + build-jvm: + runs-on: ubuntu-22.04 + name: Sjsonnet jvm build + steps: + - uses: actions/checkout@v6 + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + java-version: 21 + distribution: 'zulu' + cache: sbt + - uses: sbt/setup-sbt@v1 + - name: Cache Coursier cache + uses: coursier/cache-action@90c37294538be80a558fd665531fcdc2b467b475 # 8.1.0 + - name: Check Formatting + run: ./mill "_.jvm[_].__.checkFormat" + - name: Run mill tests + timeout-minutes: 15 + run: ./mill "_.jvm[_].__.test" + - name: Run sbt tests + timeout-minutes: 15 + run: sbt test + build-graal: + runs-on: ubuntu-22.04 + name: Sjsonnet Graal Native build + steps: + - uses: actions/checkout@v6 + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + java-version: 21 + distribution: 'zulu' + - name: Cache Coursier cache + uses: coursier/cache-action@90c37294538be80a558fd665531fcdc2b467b475 # 8.1.0 + - name: Run Native Image Test Suites + timeout-minutes: 15 + run: sjsonnet/test/graalvm/run_test_suites.py + build-other: runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: - lang: ['jvm', 'js', 'wasm', 'native'] - java: ['21', '25'] - name: Sjsonnet build for ${{ matrix.lang }} on JDK ${{ matrix.java }} + lang: ['js', 'wasm', 'native'] + name: Sjsonnet ${{ matrix.lang }} build steps: - uses: actions/checkout@v6 - - name: Set up JDK ${{ matrix.java }} + - name: Set up JDK 21 uses: actions/setup-java@v5 with: - java-version: ${{ matrix.java }} + java-version: 21 distribution: 'zulu' cache: sbt - uses: sbt/setup-sbt@v1 @@ -31,20 +67,6 @@ jobs: uses: coursier/cache-action@90c37294538be80a558fd665531fcdc2b467b475 # 8.1.0 - name: Check Formatting run: ./mill _.${{ matrix.lang }}[_].__.checkFormat - - name: Compile with mill - timeout-minutes: 15 - run: ./mill _.${{ matrix.lang }}[_].__.compile - name: Run mill tests for ${{ matrix.lang }} - run: ./mill _.${{ matrix.lang }}[_].__.test - - name: Compile with sbt - timeout-minutes: 15 - if: ${{ matrix.lang == 'jvm' }} - run: sbt compile bench/compile bench/jmh:compile - - name: Run sbt tests timeout-minutes: 15 - if: ${{ matrix.lang == 'jvm' }} - run: sbt test - - name: Run Native Image Test Suites - timeout-minutes: 30 - if: ${{ (matrix.lang == 'jvm') && (matrix.java == '25') }} - run: sjsonnet/test/graalvm/run_test_suites.py + run: ./mill _.${{ matrix.lang }}[_].__.test diff --git a/.github/workflows/push-to-central.yaml b/.github/workflows/push-to-central.yaml index 325bab05..e5d868d7 100644 --- a/.github/workflows/push-to-central.yaml +++ b/.github/workflows/push-to-central.yaml @@ -9,7 +9,8 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v6 - - uses: actions/setup-java@v5 + - name: Set up JDK 21 + uses: actions/setup-java@v5 with: java-version: 21 distribution: 'zulu' diff --git a/.github/workflows/release-build.yaml b/.github/workflows/release-build.yaml index 413cf7f7..3b203793 100644 --- a/.github/workflows/release-build.yaml +++ b/.github/workflows/release-build.yaml @@ -14,7 +14,8 @@ jobs: LANG: C steps: - uses: actions/checkout@v6 - - uses: actions/setup-java@v5 + - name: Set up JDK 21 + uses: actions/setup-java@v5 with: java-version: 21 distribution: 'zulu' @@ -73,7 +74,8 @@ jobs: LANG: C steps: - uses: actions/checkout@v6 - - uses: actions/setup-java@v5 + - name: Set up JDK 21 + uses: actions/setup-java@v5 with: java-version: 21 distribution: 'zulu' @@ -126,5 +128,5 @@ jobs: with: name: sjsonnet-${{ env.VERSION }}-release path: release/* - retention-days: 30 + retention-days: 7 if-no-files-found: error diff --git a/.gitignore b/.gitignore index e1a3bea8..4f2b287c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ out/ /project/metals.sbt *.orig *.rej -*.bak \ No newline at end of file +*.bak +.bazelbsp/ diff --git a/.jvmopts b/.jvmopts index 2e143dbb..f02ef1ce 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,13 +1,3 @@ --enable-native-access=ALL-UNNAMED --XX:+UseG1GC --Xms4G -Xmx4G --Xss2M --XX:+AlwaysActAsServerClassMachine --XX:ReservedCodeCacheSize=512m --XX:NonProfiledCodeHeapSize=256m --XX:MaxGCPauseMillis=750 --XX:+UseCompressedOops --XX:MetaspaceSize=512M --XX:-ClassUnloadingWithConcurrentMark --Djava.security.egd=file:/dev/./urandom +-XX:+UseG1GC diff --git a/.mill-jvm-opts b/.mill-jvm-opts new file mode 120000 index 00000000..3037ad3f --- /dev/null +++ b/.mill-jvm-opts @@ -0,0 +1 @@ +.jvmopts \ No newline at end of file diff --git a/build.mill b/build.mill index b3fac242..742cd764 100644 --- a/build.mill +++ b/build.mill @@ -1,5 +1,5 @@ //| mill-version: 1.1.2 -//| mill-jvm-opts: ["-XX:+UseG1GC", "-Xmx4G", "--enable-native-access=ALL-UNNAMED"] +//| mill-jvm-version: zulu:21 //| mvnDeps: //| - com.lihaoyi::mill-contrib-jmh:$MILL_VERSION //| - com.lihaoyi::mill-contrib-versionfile:$MILL_VERSION @@ -36,10 +36,14 @@ trait SjsonnetPublishModule extends PublishModule { description = artifactName(), organization = "com.databricks", url = "https://github.com/databricks/sjsonnet", - licenses = Seq(License.MIT), + licenses = Seq(License.Common.Apache2), versionControl = VersionControl.github("databricks", "sjsonnet"), developers = Seq( - Developer("lihaoyi", "Li Haoyi", "https://github.com/lihaoyi") + Developer( + name = "Databricks Jsonnet Team", + organization = Some("Databricks"), + organizationUrl = Some("https://www.databricks.com") + ) ) ) } diff --git a/build.sbt b/build.sbt index 92513d55..f37e4659 100644 --- a/build.sbt +++ b/build.sbt @@ -60,15 +60,3 @@ lazy val main = (project in file("sjsonnet")) Seq(file) }.taskValue ) - -lazy val bench = (project in file("bench")) - .dependsOn(main % "compile->test") - .enablePlugins(JmhPlugin) - .settings(commonSettings: _*) - .settings( - run / fork := true, - run / javaOptions ++= Seq( - "-Xss100m", - "--enable-native-access=ALL-UNNAMED" - ) - ) diff --git a/project/build.properties b/project/build.properties index 5e6884d3..b49295c7 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.11.6 +sbt.version=1.12.5