Skip to content

Commit 843b69c

Browse files
authoredAug 27, 2024··
Test jar on CI (#671)
To catch classpath differences tools.deps invocation and the jar regarding git deps.
1 parent c288591 commit 843b69c

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed
 

‎bb.edn

+15-1
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,33 @@
9595
:out
9696
str/trim)
9797

98+
test-jar {:doc "Tests current jar"
99+
:task (do
100+
(println (str "Testing jar: 'clerk-" (t/version) ".jar'"))
101+
(clojure (str "-Sforce -Srepro -Sdeps '"
102+
(pr-str {:aliases {:test-jar {:jvm-opts ["-Dclojure.main.report=stdout"]
103+
:deps {'io.github.nextjournal/clerk {:local/root (str "./target/clerk-" (t/version) ".jar")}}
104+
:exec-fn 'nextjournal.clerk/build!
105+
:exec-args {:paths ["notebooks/hello.clj"]}}}})
106+
"' -T:test-jar")))}
107+
98108
ci:publish {:doc "Publish task which will be run on CI"
99109
:depends [-current-tag -current-branch]
100110
:task (do
101111
(prn :current-tag -current-tag)
102112
(prn :current-branch -current-branch)
103113
(if (and -current-tag (= "main" -current-branch))
104114
(do
115+
(println "Building jar")
116+
(clojure "-T:build jar")
117+
(run 'test-jar)
105118
(println "Deploying to clojars")
106119
(clojure "-T:build deploy"))
107120
;; still build jar with updated commit count for artifact upload
108121
(do
109122
(run 'update-meta)
110-
(run 'jar))))}
123+
(run 'jar)
124+
(run 'test-jar))))}
111125

112126
uninstall-git-hooks {:doc "Uninstall git hooks we installed previously and no longer need"
113127
:task (fs/delete-if-exists ".git/hooks/pre-commit")}

‎build.clj

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
:class-dir class-dir}))
5656

5757
(defn deploy [opts]
58-
(jar opts)
5958
(try ((requiring-resolve 'deps-deploy.deps-deploy/deploy)
6059
(merge {:installer :remote
6160
:artifact jar-file

0 commit comments

Comments
 (0)
Please sign in to comment.