Skip to content

Commit

Permalink
[new] Add initial repo project content
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Oct 16, 2023
1 parent e3cbc6c commit 89027cc
Show file tree
Hide file tree
Showing 13 changed files with 274 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/graal-tests.yml
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@v3
- 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@v3
with:
path: ~/.m2/repository
key: deps-${{ hashFiles('deps.edn') }}
restore-keys: deps-

- run: bb graal-tests
30 changes: 30 additions & 0 deletions .github/workflows/main-tests.yml
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@v3
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: ${{ matrix.java }}

- uses: DeLaGuardo/[email protected]
with:
lein: latest

- uses: actions/cache@v3
id: cache-deps
with:
path: ~/.m2/repository
key: deps-${{ hashFiles('project.clj') }}
restore-keys: deps-

- run: lein test-all
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This project uses [**Break Versioning**](https://www.taoensso.com/break-versioning).

---
2 changes: 2 additions & 0 deletions FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: ptaoussanis
custom: "https://www.taoensso.com/clojure"
61 changes: 59 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,59 @@
# telemere
Coming later
<a href="https://www.taoensso.com/clojure" title="More stuff by @ptaoussanis at www.taoensso.com"><img src="https://www.taoensso.com/open-source.png" alt="Taoensso open source" width="340"/></a>
[**Documentation**](#documentation) | [Latest releases](#latest-releases) | [Get support][GitHub issues]

# Telemere

### Coming soon

This library is **still under development** and not available yet for public use.

ETA: [~Dec 2023](https://www.taoensso.com/clojure/roadmap).

## Latest release/s

- Coming later

[![Main tests][Main tests SVG]][Main tests URL]
[![Graal tests][Graal tests SVG]][Graal tests URL]

See [here][GitHub releases] for earlier releases.

## Why Telemere?

- Coming later

## Documentation

- [Full documentation][GitHub wiki] (**getting started** and more)
- Auto-generated API reference: [Codox][Codox docs], [clj-doc][clj-doc docs]

## Funding

You can [help support][sponsor] continued work on this project, thank you!! 🙏

## License

Copyright &copy; 2023 [Peter Taoussanis][].
Licensed under [EPL 1.0](LICENSE.txt) (same as Clojure).

<!-- Common -->

[GitHub releases]: ../../releases
[GitHub issues]: ../../issues
[GitHub wiki]: ../../wiki

[Peter Taoussanis]: https://www.taoensso.com
[sponsor]: https://www.taoensso.com/sponsor

<!-- Project -->

[Codox docs]: https://taoensso.github.io/telemere/
[clj-doc docs]: https://cljdoc.org/d/com.taoensso/telemere/

[Clojars SVG]: https://img.shields.io/clojars/v/com.taoensso/telemere.svg
[Clojars URL]: https://clojars.org/com.taoensso/telemere

[Main tests SVG]: https://github.com/taoensso/telemere/actions/workflows/main-tests.yml/badge.svg
[Main tests URL]: https://github.com/taoensso/telemere/actions/workflows/main-tests.yml
[Graal tests SVG]: https://github.com/taoensso/telemere/actions/workflows/graal-tests.yml/badge.svg
[Graal tests URL]: https://github.com/taoensso/telemere/actions/workflows/graal-tests.yml
10 changes: 10 additions & 0 deletions bb.edn
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))}}}
38 changes: 38 additions & 0 deletions bb/graal_tests.clj
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!")))
2 changes: 2 additions & 0 deletions doc/cljdoc.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{:cljdoc/docstring-format :plaintext}

74 changes: 74 additions & 0 deletions project.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
(defproject com.taoensso/telemere "1.0.0-SNAPSHOT"
:author "Peter Taoussanis <https://www.taoensso.com>"
:description "Coming soon"
:url "https://github.com/taoensso/tempel"

:license
{:name "Eclipse Public License - v 1.0"
:url "https://www.eclipse.org/legal/epl-v10.html"}

:dependencies
[[com.taoensso/encore "3.68.0"]]

:profiles
{;; :default [:base :system :user :provided :dev]
:provided {:dependencies [[org.clojure/clojure "1.11.1"]]}
:c1.11 {:dependencies [[org.clojure/clojure "1.11.1"]]}
:c1.10 {:dependencies [[org.clojure/clojure "1.10.1"]]}
:c1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}

:test
{:jvm-opts ["-Dtaoensso.elide-deprecated=true"]
:global-vars
{*warn-on-reflection* true
*assert* true
*unchecked-math* false #_:warn-on-boxed}

:dependencies
[[org.clojure/test.check "1.1.1"]]}

:graal-tests
{:dependencies [[org.clojure/clojure "1.11.1"]
[com.github.clj-easy/graal-build-time "1.0.5"]]
:main taoensso.graal-tests
:aot [taoensso.graal-tests]
:uberjar-name "graal-tests.jar"}

:dev
[:c1.11 :test
{:jvm-opts ["-server"]
:plugins
[[lein-pprint "1.3.2"]
[lein-ancient "0.7.0"]
[com.taoensso.forks/lein-codox "0.10.10"]]

:codox
{:language #{:clojure :clojurescript}
:base-language :clojure}}]}

:test-paths ["test" #_"src"]

:cljsbuild
{:test-commands {"node" ["node" "target/test.js"]}
:builds
[{:id :main
:source-paths ["src"]
:compiler
{:output-to "target/main.js"
:optimizations :advanced}}

{:id :test
:source-paths ["src" "test"]
:compiler
{:output-to "target/test.js"
:target :nodejs
:optimizations :simple}}]}

:aliases
{"start-dev" ["with-profile" "+dev" "repl" ":headless"]
"build-once" ["do" ["clean"] ["cljsbuild" "once"]]
"deploy-lib" ["do" ["build-once"] ["deploy" "clojars"] ["install"]]

"test-clj" ["with-profile" "+c1.11:+c1.10:+c1.9" "test"]
"test-cljs" ["with-profile" "+test" "cljsbuild" "test"]
"test-all" ["do" ["clean"] ["test-clj"] ["test-cljs"]]})
1 change: 1 addition & 0 deletions src/taoensso/telemere.cljc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(ns taoensso.telemere)
5 changes: 5 additions & 0 deletions test/taoensso/graal_tests.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(ns taoensso.graal-tests
(:require [taoensso.telemere :as telemere])
(:gen-class))

(defn -main [& args] (println "Namespace loaded successfully"))
17 changes: 17 additions & 0 deletions test/taoensso/telemere_tests.cljc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(ns taoensso.telemere-tests
(:require
[clojure.test :as test :refer [deftest testing is]]
[taoensso.encore :as enc]
[taoensso.telemere :as telemere]))

(comment
(remove-ns 'taoensso.telemere-tests)
(test/run-tests 'taoensso.telemere-tests))

;;;;

(deftest _test (is (= 1 1)))

;;;;

#?(:cljs (test/run-tests))
2 changes: 1 addition & 1 deletion wiki/Home.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Init
Coming soon

0 comments on commit 89027cc

Please sign in to comment.