Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 27 additions & 22 deletions .github/workflows/commit_validation.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# V1 - For all projects
name: Commit validation
on:
push:
Expand All @@ -15,48 +16,52 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Cache clojure dependencies
uses: actions/cache@v4
with:
path: /home/runner/.m2/repository
key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }}
restore-keys: cljdeps-
- name: Install java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '22'
distribution: 'temurin'
java-version: '21'
check-latest: true
- name: Install clojure tools
# See https://github.com/DeLaGuardo/setup-clojure/commits/main/
uses: DeLaGuardo/setup-clojure@cc67f8308550d0f18b0ba445c2476f84626a5d6a #v13.0
uses: DeLaGuardo/setup-clojure@3fe9b3ae632c6758d0b7757b0838606ef4287b08 #v13.2
with:
cli: 1.12.0.1479 # Clojure CLI based on tools.deps
bb: 1.12.195 # Babashka
clj-kondo: 2024.11.14 # Clj-kondo
zprint: 1.2.9 # zprint
cli: 1.12.3.1577
bb: 1.12.209
clj-kondo: 2025.10.23
zprint: 1.3.0
- name: Lint
run: bb lint -v
- name: Setup zprint
run: echo "{:search-config? true}" >> ~/.zprintrc
- name: Install fdfind
run: sudo rm /var/lib/man-db/auto-update && sudo apt-get install -y fd-find && mkdir -p ~/.local/bin/ && PATH=$PATH:~/.local/bin/ && ln -s $(which fdfind) ~/.local/bin/fd
- name: Install fd-find
run: |
sudo apt-get update
sudo apt-get install -y fd-find
mkdir -p ~/.local/bin
ln -s "$(which fdfind)" ~/.local/bin/fd
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Cache clojure dependencies
uses: actions/cache@v4
with:
path: /home/runner/.m2/repository
key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn', '.github/workflows/commit_validation.yml') }}
restore-keys: cljdeps-
- name: format again to check the code pushed was uptodate
run: bb format -v
- name: Write git diff - show what has been changed by zprint
run: git diff
- name: Pushed code should already be formatted
# See https://github.com/CatChen/check-git-status-action
uses: CatChen/check-git-status-action@bde80484b437cece974f79da735a5cd1dfdc9b0b #v1
uses: CatChen/check-git-status-action@d75bdbea704869e2a3b01111b4a82c49e9bd348d #v1.4.4
with:
fail-if-not-clean: true
request-changes-if-not-clean: false
push-if-not-clean: false
- name: test code in clojure
run: bb clj-test test-clj -v
- name: test code in clojurescript
run: bb cljs-node-test all -v
- name: test
run: bb gha
- name: print infos just for debugging, and the logs
run: bb heph-info
2 changes: 1 addition & 1 deletion .github/workflows/deploy_clojar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
# This step checks out a copy of your repository.
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: jlesquembre/clojars-publish-action@89a4eb7bdbe1270621e6643250afce152701699e # v0.3
env:
Expand Down
3 changes: 2 additions & 1 deletion .zprintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
;;See [doc](https://github.com/kkinnear/zprint/blob/d0bb27e51ac97b1cdae5ea32b9b953f66cd650b2/doc/reference.md#introduction-to-configuration) for more details
;; V1 - For all projects
;; See [doc](https://github.com/kkinnear/zprint/blob/d0bb27e51ac97b1cdae5ea32b9b953f66cd650b2/doc/reference.md#introduction-to-configuration) for more details
{:style [:community
:how-to-ns
:sort-require
Expand Down
46 changes: 24 additions & 22 deletions bb.edn
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{:deps {io.github.hephaistox/auto-build {:git/sha "e907e29f65049a805c5a33e2f60bbe838c268a1a"}}
:paths ["src"]
{:deps {com.github.hephaistox/auto-build {:git/sha "cd0854aaba46d240ac4852b97d1f4f708ed626dc"}}
:paths []
:tasks
{:init (do (def ^:dynamic exit System/exit))
:requires [;;NOTE Should be as small as possible to ensure `lconnect`
;;can start whatever the state of the code is.
[auto-build.os.exit-codes]]
{:requires [[auto-build.os.exit-codes] [auto-build.os.exiting :refer [exit]]]
bp {:doc "Before push"
:task (binding [exit (fn [exit-code & _] (when-not (zero? exit-code) exit-code))]
(-> (or (run 'format)
Expand All @@ -18,15 +15,21 @@
clean {:doc "Clean temporary files"
:requires [[auto-build.tasks.clean :as task-clean]
[auto-build.echo :refer [level1-header]]]
:task (-> (task-clean/clean level1-header "." [".DS_Store"] [".cpcache"] (current-task))
:task (-> (task-clean/clean level1-header
"."
[".DS_Store"]
["node_modules" ".cpcache" "target"]
(current-task))
exit)}
clj-test
{:doc "Test with clj"
:requires [[auto-build.tasks.clj-test :as build-clj-test]
[auto-build.echo :refer [level1-header]]]
:task (->
(build-clj-test/clj-test level1-header "." "clj-test-runner" (current-task) ["test-clj"])
exit)}
clj-test {:doc "Test with clj"
:requires [[auto-build.tasks.clj-test :as build-clj-test]
[auto-build.echo :refer [level1-header]]]
:task (-> (build-clj-test/clj-test level1-header
"."
"clj-test-runner"
(current-task)
["test-clj" "test-demo"])
exit)}
cljs-browser-test
{:doc "Test with cljs in browser"
:requires [[auto-build.tasks.cljs-browser-test :as build-cljs-browser]
Expand All @@ -40,6 +43,9 @@
[auto-build.echo :refer [level1-header]]]
:task (-> (build-cljs-node-test/cljs-node-test level1-header "." (current-task) ["ltest"])
exit)}
copy {:doc "Copy files from source projects (as defined in ext_src.edn)"
:requires [[auto-build.tasks.copy :as tc] [auto-build.echo :refer [level1-header]]]
:task (tc/run level1-header "ext_src.edn")}
deploy {:doc "Deploy"
:requires [[auto-build.tasks.deploy :as task-deploy]
[auto-build.echo :refer [level1-header]]]
Expand All @@ -56,6 +62,8 @@
[auto-build.echo :refer [level1-header]]]
:task (-> (task-format/format level1-header "." (current-task))
exit)}
gha {:doc "For github action tests"
:task (do (shell "bb clj-test test-clj -v") (shell "bb cljs-node-test all -v"))}
heph-info {:doc "Hephaistox project info"
:extra-paths ["env/dev/resources"]
:requires [[auto-build.tasks.heph-info :as heph-info]
Expand All @@ -69,11 +77,5 @@
repl {:doc "Clojure repl"
:override-builtin true
:requires [[auto-build.tasks.repl :as build-repl] [auto-build.echo :refer [level1-header]]]
:task (-> (build-repl/repl level1-header "." (current-task))
exit)}
uberjar {:doc "Uberjar"
:override-builtin true
:requires [[auto-build.tasks.uberjar :as build-uberjar]
[auto-build.echo :refer [level1-header]]]
:task (-> (build-uberjar/uberjar level1-header "." "target/uberjar" "")
exit)}}}
:task (-> (build-repl/repl level1-header "." (current-task) [:cljs-deps] 7008)
exit)}}}
22 changes: 0 additions & 22 deletions build/compile.clj

This file was deleted.

61 changes: 26 additions & 35 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,49 +1,40 @@
{:aliases
{:antq {:deps {com.github.liquidz/antq {:mvn/version "2.10.1241"}}
{:antq {:deps {com.github.liquidz/antq {:mvn/version "2.11.1276"}}
:main-opts ["-m" "antq.core"]}
:build {:deps {io.github.clojure/tools.build {:git/sha "52cf7d6"
:git/tag "v0.10.6"}}
:extra-paths ["build"]}
:clj-test-runner {:exec-fn cognitect.test-runner.api/test
:extra-deps {com.cognitect/test-runner
{:git/url "https://github.com/cognitect-labs/test-runner"
:sha "3f288f1f16d167723ad87cc35b1dfee3c1681e10"}}}
:cljs-deps {:extra-deps {metosin/malli #:mvn{:version "0.16.1"}
thheller/shadow-cljs {:mvn/version "2.28.19"}}
:extra-paths
["src/cljc" "src/cljs" "env/dev/resources" "test/cljc" "test/cljs" "test/resources"]}
:cljs-deps {:extra-deps {binaryage/devtools {:mvn/version "1.0.7"}
com.github.hephaistox/auto-web
{:git/sha "e7446ec83262c36baecf3af11c7530b0d2e97eb8"}
com.github.hephaistox/auto_web {:local/root "../auto_web"}
devcards/devcards {:mvn/version "0.2.7"}
re-frame/re-frame {:mvn/version "1.4.3"}
re-frisk/re-frisk {:mvn/version "1.7.1"}
thheller/shadow-cljs {:mvn/version "3.2.1"}}
:extra-paths ["src/cljc"
"src/cljs"
"test/unit/cljc"
"../auto_web/src/cljs"
"../auto_web/src/cljs"
"test/demo/cljc"
"env/devcards/src/cljs"]}
:codox {:exec-args
{:description
"`auto-sim` is about all core technical functionalities we may need to start a project."
{:description "`auto-sim` provide simulation features (activity and event based)"
:doc-paths ["docs/codox"]
:metadata {:doc/format :markdown}
:name "auto-sim"
:source-uri "https://github.com/hephaistox/auto-sim/blob/{version}/{filepath}#L{line}"}
:exec-fn codox.main/generate-docs
:extra-deps {codox/codox {:mvn/version "0.10.8"}}}
:repl {:exec-args {:port 7001}
:repl {:exec-args {:port 7007}
:exec-fn auto-build.repl.entry-point/start
:extra-deps {cider/cider-nrepl {:mvn/version "0.50.2"}
io.github.hephaistox/auto-build {:git/sha
"e907e29f65049a805c5a33e2f60bbe838c268a1a"}
refactor-nrepl/refactor-nrepl {:mvn/version "3.10.0"}}
:extra-paths
["env/dev/resources" "test/clj" "test/cljc" "test/resources" "test/src" "test/resources"]}
:test-clj {:extra-paths ["test/clj" "test/cljc" "test/resources"]
:main-opts
["-m" "cognitect.test-runner" "-r" ".*-test.*" "-d" "test/clj" "test/cljc"]}}
:deps {babashka/fs #:mvn{:version "0.5.22"}
babashka/process #:mvn{:version "0.5.22"}
com.taoensso/tempura #:mvn{:version "1.5.4"}
com.yetanalytics/colossal-squuid {:mvn/version "0.1.5"}
danlentz/clj-uuid #:mvn{:version "0.2.0"}
http-kit/http-kit #:mvn{:version "2.8.0"}
lambdaisland/uri #:mvn{:version "1.19.155"}
metosin/malli #:mvn{:version "0.16.1"}
mount/mount #:mvn{:version "0.1.20"}
org.apache.logging.log4j/log4j-api #:mvn{:version "2.24.1"}
org.apache.logging.log4j/log4j-core #:mvn{:version "2.24.1"}
org.apache.logging.log4j/log4j-slf4j2-impl #:mvn{:version "2.24.1"}
org.clojure/tools.cli {:mvn/version "1.1.230"}
org.clojure/tools.logging #:mvn{:version "1.3.0"}}
:paths ["src/cljc" "src/clj"]}
:extra-paths ["test/unit/cljc" "test/demo/cljc"]
:jvm-opts ["-Djdk.attach.allowAttachSelf=true"]}
:test-clj {:extra-paths ["test/unit/cljc"]
:main-opts ["-m" "cognitect.test-runner" "-r" ".*-test.*" "-d" "test/unit/cljc"]}
:test-demo {:extra-paths ["test/demo/cljc"]
:main-opts ["-m" "cognitect.test-runner" "-r" ".*" "-d" "test/demo/cljc"]}}
:deps {com.github.hephaistox/auto-opti {:git/sha "fbcce94ddf956794c27c90387b2a9f975560eb25"}}
:paths ["src/cljc" "src/clj" "resources"]}
Binary file added docs/img/automaton_duck.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions env/devcards/resources/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta charset="UTF-8"/>
<link href="css/components.css" rel="stylesheet" type="text/css"/>
<link href="css/w3_colors_flat.css" rel="stylesheet" type="text/css"/>
<link href="css/w3_schools.css" rel="stylesheet" type="text/css"/>
<link href="fontawesome/css/all.css" rel="stylesheet" type="text/css"/>
<link href="fontawesome/css/all.min.css" rel="stylesheet" type="text/css"/>
<script href="fontawesome/css/all.min.css" rel="stylesheet" type="text/css"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js" type="text/javascript"></script>
<script src="/js/test.js" type="text/javascript"></script>
</head>
<body>
<script>
auto_sim.devcards.init();
</script>
</body>
</html>
65 changes: 65 additions & 0 deletions env/devcards/src/cljs/auto_sim/animation_cards.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
(ns auto-sim.animation-cards
(:require
[auto-sim :as-alias sim]
[auto-sim.animation :refer [trajectory]]
[auto-sim.component.time-picker :refer [time-picker]]
[devcards.core :refer [defcard-rg]]
[devcards.util.edn-renderer :refer [html-edn]]
[re-frame.core :refer [dispatch dispatch-sync subscribe]]
[re-frame.db :refer [app-db]]))

;; (defn- box-example
;; [pos class-color]
;; [:div {:style {:left (str (:x pos) "px")
;; :top (str (:y pos) "px")
;; :height "10px"
;; :width "10px"
;; :position "absolute"}
;; :class class-color}])

;; (dispatch-sync [::sim/time-picker-init
;; :animation
;; {:min 10
;; :max 96
;; :default 35
;; :step 2
;; :fast-step 11}])

;; (defcard-rg trajectory-card
;; "## Two black boxes animated with a time-picker"
;; (fn [_ _]
;; (let [time @(subscribe [::sim/time-picker :animation])
;; src-pos {:x 5
;; :y 5
;; :t 13}
;; dst-pos {:x 95
;; :y 55
;; :t 30}
;; src-pos2 {:x 5
;; :y 5
;; :t 30}
;; dst-pos2 {:x 5
;; :y 35
;; :t 90}]
;; [:div
;; [:div.w3-row
;; [time-picker {:class "w3-half"}
;; :animation]
;; [:input.w3-half {:value @(subscribe [::sim/time-picker :animation])
;; :readOnly true}]]
;; [:button {:on-click #(dispatch [::sim/start :trajectory-test 20])}
;; "Start"]
;; [:button {:on-click #(dispatch [::sim/stop :trajectory-test])}
;; "Stop"]
;; [:div {:style {:width "100px "
;; :height "100px"
;; :position "relative"}}
;; (box-example src-pos "w3-grey")
;; (box-example (trajectory time src-pos dst-pos) "w3-black")
;; (box-example (trajectory time src-pos2 dst-pos2) "w3-black")
;; (box-example dst-pos "w3-grey")]
;; [:div
;; [html-edn
;; (-> @app-db
;; (select-keys [::sim/time-picker])
;; (update ::sim/time-picker #(select-keys % [:animation])))]]])))
Loading
Loading