Skip to content

Commit

Permalink
ci: prepare for clojars deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
dekelpilli committed May 1, 2022
1 parent 72579f2 commit 97990bd
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 deletions.
36 changes: 36 additions & 0 deletions build.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
(ns build
"HoneySQL's build script.
clojure -T:build ci
clojure -T:build run-doc-tests :aliases '[:cljs]'
Run tests:
clojure -X:test
clojure -X:test:master
For more information, run:
clojure -A:deps -T:build help/doc"
(:refer-clojure :exclude [test])
(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]))

(def lib 'com.github.dekelpilli/randy)
(def version (format "0.0.%s" (b/git-count-revs nil)))

(defn test [opts]
(bb/run-tests opts))

(defn clean [opts]
(bb/clean opts))

(defn jar [opts]
(-> opts
(assoc :lib lib :version version)
(bb/jar)))

(defn deploy [opts]
(-> opts
(assoc :lib lib :version version)
(bb/deploy)))
8 changes: 6 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
org.clojure/clojurescript {:mvn/version "1.11.4"}}
:aliases {:test {:extra-deps {lambdaisland/kaocha {:mvn/version "1.65.1029"}
incanter/incanter-charts {:mvn/version "1.9.3"}
incanter/incanter-core {:mvn/version "1.9.3"}}}
incanter/incanter-core {:mvn/version "1.9.3"}}
:main-opts ["-m" "kaocha.runner"]}
:outdated {:extra-deps {olical/depot {:mvn/version "2.3.0"}}
:main-opts ["-m" "depot.outdated.main"]}}
:main-opts ["-m" "depot.outdated.main"]}
:build {:deps {io.github.seancorfield/build-clj {:git/tag "v0.8.0" :git/sha "9bd8b8a"}
lambdaisland/kaocha {:mvn/version "1.65.1029"}}
:ns-default build}}
:test-paths ["test"]}
4 changes: 2 additions & 2 deletions test/randy/swr_perf.clj → perf/src/swr_perf.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns randy.swr-perf
(ns swr-perf
(:require [clojure.test :refer [deftest is testing]]
[randy.core :as r]
[randy.rng :as rng]
Expand Down Expand Up @@ -42,7 +42,7 @@
(inc c))))))

; amalloy, o(mg)
(defn take-transient [rng nr coll] ;TODO eager version of this to avoid o(m) vec
(defn take-transient [rng nr coll]
(take nr
((fn shuffle [coll]
(lazy-seq
Expand Down
4 changes: 2 additions & 2 deletions test/randy/core_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
(testing "maintains weighting ratio, total to 1"
(is (= [2/10 5/10 3/10] (sut/weightings->probabilities [20 50 30])))
(is (= [2/3 1/3] (sut/weightings->probabilities [1/2 1/4])))
(is (= (every? ratio? (sut/weightings->probabilities [33 34 16 17 3]))))
(is (= (every? double? (sut/weightings->probabilities [33.0 34.0 16.0 17.0 3.0]))))))
(is (every? ratio? (sut/weightings->probabilities [33 34 16 17 3])))
(is (every? double? (sut/weightings->probabilities [33.0 34.0 16.0 17.0 3.0])))))


(defn- alias-faux-randomiser [index probability-roll]
Expand Down
4 changes: 4 additions & 0 deletions tests.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#kaocha/v1
{:tests [{:id :unit
:test-paths ["test" "src"]
:ns-patterns [".*"]}]}

0 comments on commit 97990bd

Please sign in to comment.