From 1f888b6e2ce654129e1608d64734a2960f29882d Mon Sep 17 00:00:00 2001 From: Jose Gomez Date: Fri, 20 Sep 2024 22:23:31 -0500 Subject: [PATCH] chore: more testing --- .github/workflows/clojure.yml | 10 +++++++--- Makefile | 19 ++++++++++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/clojure.yml b/.github/workflows/clojure.yml index 2971fc1..94e392a 100644 --- a/.github/workflows/clojure.yml +++ b/.github/workflows/clojure.yml @@ -14,11 +14,16 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - - name: Tools setup + - name: SDK Tools setup uses: jdx/mise-action@v2 with: install: true cache: true + - name: Native Image setup + run: | + echo "JAVA_HOME=$(mise where java)" >> $GITHUB_ENV + echo "GRAALVM_HOME=$(mise where java)" >> $GITHUB_ENV + gu install native-image - name: Run tests run: make test - name: Run clj-kondo linter @@ -28,5 +33,4 @@ jobs: - name: Run build app run: | printenv - gu install native-image - bin/build-native + make build-native diff --git a/Makefile b/Makefile index 3f42a4f..7ce2f1f 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,24 @@ build: clojure -X:jar :sync-pom true :jar "build/hierarchy.jar" build-native: build - bin/build-native + mkdir -p build/graalvm-config + clojure -X:uberjar :sync-pom false :jar "build/hierarchy-test-app.jar" + java -agentlib:native-image-agent=config-output-dir=build/graalvm-config -jar "build/hierarchy-test-app.jar" hierarchy.main + native-image -jar "build/hierarchy-test-app.jar" \ + "-H:+ReportExceptionStackTraces" \ + "-H:+JNI" \ + "-H:EnableURLProtocols=http,https,jar" \ + "-J-Dclojure.spec.skip-macros=true" \ + "-J-Dclojure.compiler.direct-linking=true" \ + "--report-unsupported-elements-at-runtime" \ + "--verbose" \ + "--no-fallback" \ + "--no-server" \ + "--allow-incomplete-classpath" \ + "--trace-object-instantiation=java.lang.Thread" \ + "--features=clj_easy.graal_build_time.InitClojureClasses" \ + "-H:ConfigurationFileDirectories=build/graalvm-config" \ + "build/hierarchy-test-app" deploy: clean build clojure -X:deploy-maven