-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
533dd0b
commit 4c74895
Showing
11 changed files
with
175 additions
and
81 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Graal tests | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
java: ['17'] | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
version: 'latest' | ||
java-version: ${{ matrix.java }} | ||
components: 'native-image' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: DeLaGuardo/setup-clojure@12.5 | ||
with: | ||
lein: latest | ||
bb: latest | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: deps-${{ hashFiles('deps.edn') }} | ||
restore-keys: deps- | ||
|
||
- run: bb graal-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Main tests | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
strategy: | ||
matrix: | ||
java: ['17', '18', '19'] | ||
os: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'corretto' | ||
java-version: ${{ matrix.java }} | ||
|
||
- uses: DeLaGuardo/setup-clojure@12.5 | ||
with: | ||
lein: latest | ||
|
||
- uses: actions/cache@v4 | ||
id: cache-deps | ||
with: | ||
path: ~/.m2/repository | ||
key: deps-${{ hashFiles('project.clj') }} | ||
restore-keys: deps- | ||
|
||
- run: lein test-all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
github: ptaoussanis | ||
custom: "https://www.taoensso.com/clojure/backers" | ||
custom: "https://www.taoensso.com/clojure" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{:paths ["bb"] | ||
:tasks | ||
{:requires ([graal-tests]) | ||
graal-tests | ||
{:doc "Run Graal native-image tests" | ||
:task | ||
(do | ||
(graal-tests/uberjar) | ||
(graal-tests/native-image) | ||
(graal-tests/run-tests))}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bb | ||
|
||
(ns graal-tests | ||
(:require | ||
[clojure.string :as str] | ||
[babashka.fs :as fs] | ||
[babashka.process :refer [shell]])) | ||
|
||
(defn uberjar [] | ||
(let [command "lein with-profiles +graal-tests uberjar" | ||
command | ||
(if (fs/windows?) | ||
(if (fs/which "lein") | ||
command | ||
;; Assume PowerShell powershell module | ||
(str "powershell.exe -command " (pr-str command))) | ||
command)] | ||
|
||
(shell command))) | ||
|
||
(defn executable [dir name] | ||
(-> (fs/glob dir (if (fs/windows?) (str name ".{exe,bat,cmd}") name)) | ||
first | ||
fs/canonicalize | ||
str)) | ||
|
||
(defn native-image [] | ||
(let [graalvm-home (System/getenv "GRAALVM_HOME") | ||
bin-dir (str (fs/file graalvm-home "bin"))] | ||
(shell (executable bin-dir "gu") "install" "native-image") | ||
(shell (executable bin-dir "native-image") "-jar" "target/graal-tests.jar" "--no-fallback" "graal_tests"))) | ||
|
||
(defn run-tests [] | ||
(let [{:keys [out]} (shell {:out :string} (executable "." "graal_tests"))] | ||
(assert (str/includes? out "loaded") out) | ||
(println "Native image works!"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(ns taoensso.graal-tests | ||
(:require [taoensso.tempura :as tempura]) | ||
(:gen-class)) | ||
|
||
(defn -main [& args] (println "Namespace loaded successfully")) |