-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
742fd3c
commit c620d39
Showing
10 changed files
with
195 additions
and
92 deletions.
There are no files selected for viewing
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/[email protected] | ||
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/[email protected] | ||
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: ptaoussanis | ||
custom: "https://www.taoensso.com/clojure" |
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,38 @@ | ||
#!/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") | ||
"--features=clj_easy.graal_build_time.InitClojureClasses" | ||
"--no-fallback" "-jar" "target/graal-tests.jar" "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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,83 @@ | ||
(defproject com.taoensso/tower "3.1.0-beta5" | ||
:author "Peter Taoussanis <https://www.taoensso.com>" | ||
:description "Clojure/Script i18n & L10n library" | ||
:url "https://github.com/ptaoussanis/tower" | ||
:license {:name "Eclipse Public License" | ||
:url "http://www.eclipse.org/legal/epl-v10.html" | ||
:distribution :repo | ||
:comments "Same as Clojure"} | ||
:min-lein-version "2.3.3" | ||
:global-vars {*warn-on-reflection* true | ||
*assert* true} | ||
:description "i18n & L10n library for Clojure/Script" | ||
:url "https://github.com/taoensso/tower" | ||
|
||
:license | ||
{:name "Eclipse Public License - v 1.0" | ||
:url "https://www.eclipse.org/legal/epl-v10.html"} | ||
|
||
:test-paths ["test" #_"src"] | ||
|
||
:dependencies | ||
[[org.clojure/clojure "1.5.1"] | ||
[com.taoensso/encore "2.68.0"] | ||
[[com.taoensso/encore "2.68.0"] | ||
[com.taoensso/timbre "4.7.3"] | ||
[markdown-clj "0.9.89"]] | ||
|
||
:plugins | ||
[[lein-pprint "1.1.2"] | ||
[lein-ancient "0.6.10"] | ||
[lein-codox "0.9.5"]] | ||
|
||
:profiles | ||
{;; :default [:base :system :user :provided :dev] | ||
:server-jvm {:jvm-opts ^:replace ["-server"]} | ||
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]} | ||
:1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]} | ||
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]} | ||
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]} | ||
:1.9 {:dependencies [[org.clojure/clojure "1.9.0-alpha10"]]} | ||
:test {:dependencies [[org.clojure/test.check "0.9.0"] | ||
[expectations "2.1.9"] | ||
[ring/ring-core "1.5.0"]] | ||
:plugins [[lein-expectations "0.0.8"] | ||
[lein-autoexpect "1.4.2"]]} | ||
:provided {:dependencies [[org.clojure/clojurescript "1.11.60"] | ||
[org.clojure/clojure "1.11.1"]]} | ||
:c1.12 {:dependencies [[org.clojure/clojure "1.12.0-alpha9"]]} | ||
:c1.11 {:dependencies [[org.clojure/clojure "1.11.1"]]} | ||
:c1.10 {:dependencies [[org.clojure/clojure "1.10.3"]]} | ||
:c1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]} | ||
|
||
:graal-tests | ||
{:source-paths ["test"] | ||
:main taoensso.graal-tests | ||
:aot [taoensso.graal-tests] | ||
:uberjar-name "graal-tests.jar" | ||
:dependencies | ||
[[org.clojure/clojure "1.11.1"] | ||
[com.github.clj-easy/graal-build-time "1.0.5"]]} | ||
|
||
:dev | ||
[:1.9 :test :server-jvm | ||
{:dependencies | ||
[[org.clojure/clojurescript "1.9.93"]] | ||
{:jvm-opts ["-server" #_"-Dtaoensso.elide-deprecated=true"] | ||
|
||
:global-vars | ||
{*warn-on-reflection* true | ||
*assert* true | ||
*unchecked-math* false #_:warn-on-boxed} | ||
|
||
:plugins | ||
[;; These must be in :dev, Ref. https://github.com/lynaghk/cljx/issues/47: | ||
[com.keminglabs/cljx "0.6.0"] | ||
[lein-cljsbuild "1.1.3"]]}]} | ||
:dependencies | ||
[[org.clojure/test.check "0.9.0"] | ||
[expectations "2.1.9"] | ||
[ring/ring-core "1.5.0"]] | ||
|
||
:source-paths ["src" "target/classes"] | ||
:test-paths ["src" "test" "target/test-classes"] | ||
:plugins | ||
[[lein-expectations "0.0.8"] | ||
[lein-autoexpect "1.4.2"] | ||
[lein-pprint "1.3.2"] | ||
[lein-ancient "0.7.0"] | ||
[lein-cljsbuild "1.1.8"] | ||
[com.taoensso.forks/lein-codox "0.10.11"]] | ||
|
||
:cljx | ||
{:builds | ||
[{:source-paths ["src"] :rules :clj :output-path "target/classes"} | ||
{:source-paths ["src"] :rules :cljs :output-path "target/classes"} | ||
{:source-paths ["src" "test"] :rules :clj :output-path "target/test-classes"} | ||
{:source-paths ["src" "test"] :rules :cljs :output-path "target/test-classes"}]} | ||
:codox | ||
{:language #{:clojure :clojurescript} | ||
:base-language :clojure}}} | ||
|
||
:cljsbuild | ||
{:test-commands {} | ||
{:test-commands {"node" ["node" "target/test.js"]} | ||
:builds | ||
[{:id "main" | ||
:source-paths ["src" "target/classes"] | ||
;; :notify-command ["terminal-notifier" "-title" "cljsbuild" "-message"] | ||
:compiler {:output-to "target/main.js" | ||
:optimizations :advanced | ||
:pretty-print false}} | ||
{:id "tests" | ||
:source-paths ["src" "target/classes" "test" "target/test-classes"] | ||
;; :notify-command [] | ||
:compiler {:output-to "target/tests.js" | ||
:optimizations :whitespace | ||
:pretty-print true | ||
:main "taoensso.tempura.tests"}}]} | ||
|
||
:auto-clean false | ||
:prep-tasks [["cljx" "once"] "javac" "compile"] | ||
[{:id :main | ||
:source-paths ["src"] | ||
:compiler | ||
{:output-to "target/main.js" | ||
:optimizations :advanced}} | ||
|
||
:codox | ||
{:language :clojure ; [:clojure :clojurescript] ; No support? | ||
:source-paths ["target/classes"] | ||
:source-uri | ||
{#"target/classes" "https://github.com/ptaoussanis/tempura/blob/master/src/{classpath}x#L{line}" | ||
#".*" "https://github.com/ptaoussanis/tempura/blob/master/{filepath}#L{line}"}} | ||
{:id :test | ||
:source-paths ["src" "test"] | ||
:compiler | ||
{:output-to "target/test.js" | ||
:target :nodejs | ||
:optimizations :simple}}]} | ||
|
||
:aliases | ||
{"test-all" ["do" "clean," "cljx" "once," | ||
"with-profile" "+1.9:+1.8:+1.7:+1.6:+1.5" "expectations"] | ||
"build-once" ["do" "clean," "cljx" "once," "cljsbuild" "once" "main"] | ||
"deploy-lib" ["do" "build-once," "deploy" "clojars," "install"] | ||
"start-dev" ["with-profile" "+dev" "repl" ":headless"]} | ||
{"start-dev" ["with-profile" "+dev" "repl" ":headless"] | ||
"build-once" ["do" ["clean"] ["cljsbuild" "once"]] | ||
"deploy-lib" ["do" ["build-once"] ["deploy" "clojars"] ["install"]] | ||
|
||
:repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"}) | ||
"test-clj" ["with-profile" "+c1.12:+c1.11:+c1.10:+c1.9" "test"] | ||
"test-cljs" ["with-profile" "+c1.12" "cljsbuild" "test"] | ||
"test-all" ["do" ["clean"] ["test-clj"] ["test-cljs"]]}) |
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.tower :as tower]) | ||
(:gen-class)) | ||
|
||
(defn -main [& args] (println "Namespace loaded successfully")) |
4 changes: 2 additions & 2 deletions
4
test/taoensso/tower/tests/main.clj → test/taoensso/tower_tests.clj
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