File tree Expand file tree Collapse file tree 5 files changed +60
-14
lines changed Expand file tree Collapse file tree 5 files changed +60
-14
lines changed Original file line number Diff line number Diff line change 13
13
14
14
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
15
15
jobs :
16
+ tests :
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - uses : actions/checkout@v4
20
+
21
+ - uses : actions/setup-java@v4
22
+ with :
23
+ java-version : ' 23'
24
+
25
+ -
uses :
DeLaGuardo/[email protected]
26
+ with :
27
+ cli : latest
28
+
29
+ - name : Cache Clojure dependencies
30
+ uses : actions/cache@v3
31
+ with :
32
+ path : |
33
+ ~/.m2/repository
34
+ ~/.gitlibs
35
+ ~/.deps.clj
36
+ key : cljdeps-${{ hashFiles('deps.edn') }}
37
+ restore-keys : cljdeps-
38
+
39
+ - name : Run tests
40
+ run : clojure -X:test
41
+
42
+
16
43
build-and-push-image :
17
44
runs-on : ubuntu-latest
18
45
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
Original file line number Diff line number Diff line change 20
20
com.grammarly/omniconf {:mvn/version " 0.5.2" }
21
21
com.taoensso/nippy {:mvn/version " 3.4.2" }
22
22
functionalbytes/mount-lite {:mvn/version " 2.3.1" }
23
- nrepl/nrepl {:mvn/version " 1.3.0" }}
23
+ nrepl/nrepl {:mvn/version " 1.3.0" }
24
+
25
+ org.clj-commons/hickory {:mvn/version " 0.7.5" }
26
+ nubank/matcher-combinators {:mvn/version " 3.9.1" }}
24
27
25
28
:aliases
26
29
{:build {:deps {io.github.clojure/tools.build {:mvn/version " 0.10.0" }}
27
- :ns-default build}}}
30
+ :ns-default build}
31
+
32
+ :test {:extra-deps {io.github.cognitect-labs/test-runner {:git/tag " v0.5.1"
33
+ :git/sha " dfb30dd" }}
34
+ :exec-fn flamebin.test-runner/test
35
+ :jvm-opts [" -Djdk.attach.allowAttachSelf" ]}}}
28
36
29
37
#_(find-dep metosin/reitit-core)
30
- #_(deps functionalbytes/mount-lite " 2.3.1 " )
38
+ #_(deps nubank/matcher-combinators { :mvn/version " 3.9.1 " } )
Original file line number Diff line number Diff line change 2
2
(:require [clojure.java.io :as io]
3
3
[clojure.string :as str]
4
4
[mount.lite :as mount]
5
+ [mount.extensions.autostart :as mount.auto]
5
6
[omniconf.core :as cfg]
6
7
[taoensso.timbre :as log]
7
8
[taoensso.timbre.tools.logging]))
79
80
:port {:type :number
80
81
:required #(cfg/get :repl :enabled )}}}})
81
82
83
+ (def ^:dynamic *silent* false )
84
+
82
85
(defn init-config []
83
86
(cfg/populate-from-env )
84
- (cfg/verify ))
87
+ (cfg/verify :silent *silent* ))
85
88
86
89
(mount/defstate config
87
- :start (do (init-config ) (fn config-getter [& path] (apply cfg/get path))))
88
-
90
+ :start (do (init-config ) cfg/get))
89
91
#_(mount/start #'config)
90
92
91
93
; ;;; Misc initialization
Original file line number Diff line number Diff line change 3
3
(:import (io.micrometer.core.instrument DistributionSummary Metrics Timer)
4
4
(io.micrometer.prometheusmetrics PrometheusConfig PrometheusMeterRegistry)))
5
5
6
- (mount/defstate registry
7
- :start (let [reg (PrometheusMeterRegistry. PrometheusConfig/DEFAULT)]
8
- (.bindTo (io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics. ) reg)
9
- (.bindTo (io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics. ) reg)
10
- (.bindTo (io.micrometer.core.instrument.binder.jvm.JvmGcMetrics. ) reg)
11
- (.bindTo (io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics. ) reg)
12
- (.add (Metrics/globalRegistry ) reg)
13
- reg))
6
+ (defonce registry
7
+ (delay
8
+ (let [reg (PrometheusMeterRegistry. PrometheusConfig/DEFAULT)]
9
+ (.bindTo (io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics. ) reg)
10
+ (.bindTo (io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics. ) reg)
11
+ (.bindTo (io.micrometer.core.instrument.binder.jvm.JvmGcMetrics. ) reg)
12
+ (.bindTo (io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics. ) reg)
13
+ (.add (Metrics/globalRegistry ) reg)
14
+ reg)))
14
15
15
16
(defn scrape []
16
17
(.scrape @registry))
Original file line number Diff line number Diff line change
1
+ (ns flamebin.test-runner
2
+ (:require cognitect.test-runner.api
3
+ mount.lite))
4
+
5
+ (defn test [opts]
6
+ (cognitect.test-runner.api/test opts)
7
+ (mount.lite/stop )
8
+ (shutdown-agents ))
You can’t perform that action at this time.
0 commit comments