Skip to content

Commit 5c1ac41

Browse files
kordanowhilo
andauthored
Update deps (#15)
* Fix global supervisor instance, add type hints. * Factor and fix native image build check. * fix formatting * move to new build tooling and release Co-authored-by: Christian Weilbach <[email protected]>
1 parent f9f4f51 commit 5c1ac41

File tree

8 files changed

+268
-110
lines changed

8 files changed

+268
-110
lines changed

.circleci/config.yml

+135-30
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,155 @@
11
version: 2.1
22

33
orbs:
4+
github-cli: circleci/[email protected]
45
tools: replikativ/clj-tools@0
56

7+
jobs:
8+
setup:
9+
executor: tools/clojurecli
10+
parameters:
11+
setup_cljs:
12+
type: boolean
13+
default: false
14+
steps:
15+
- restore_cache:
16+
keys:
17+
- source-{{ .Branch }}-{{ .Revision }}
18+
- source-{{ .Branch }}
19+
- source-
20+
- checkout
21+
- save_cache:
22+
key: source-{{ .Branch }}-{{ .Revision }}
23+
paths:
24+
- .git
25+
- restore_cache:
26+
keys:
27+
- deps-{{ checksum "deps.edn" }}
28+
- deps-
29+
- run:
30+
name: resolve deps
31+
command: clojure -P
32+
- save_cache:
33+
key: deps-{{ checksum "deps.edn" }}
34+
paths:
35+
- /home/circleci/.m2
36+
- when:
37+
condition: <<parameters.setup_cljs>>
38+
steps:
39+
- restore_cache:
40+
keys:
41+
- npm-{{ checksum "package-lock.json" }}
42+
- npm-
43+
- run: npm ci
44+
- save_cache:
45+
key: npm-{{ checksum "package-lock.json" }}
46+
paths:
47+
- /home/circleci/.npm
48+
- persist_to_workspace:
49+
root: /home/circleci/
50+
paths:
51+
- .m2
52+
- .npm
53+
- replikativ
54+
build:
55+
executor: tools/clojurecli
56+
parameters:
57+
build_cljs:
58+
type: boolean
59+
default: false
60+
steps:
61+
- attach_workspace:
62+
at: /home/circleci
63+
- run:
64+
name: clean
65+
command: clojure -Sthreads 1 -T:build clean
66+
- run:
67+
name: jar
68+
command: clojure -Sthreads 1 -T:build jar
69+
- when:
70+
condition: <<parameters.build_cljs>>
71+
steps:
72+
- run:
73+
name: compile_cljs
74+
command: npx shadow-cljs compile ci
75+
no_output_timeout: 5m
76+
- persist_to_workspace:
77+
root: /home/circleci/
78+
paths:
79+
- .m2
80+
- replikativ
81+
82+
test:
83+
executor: tools/clojurecli
84+
parameters:
85+
test_cljs:
86+
type: boolean
87+
default: false
88+
steps:
89+
- attach_workspace:
90+
at: /home/circleci
91+
- run:
92+
name: test
93+
command: clojure -Sthreads 1 -T:build test
94+
no_output_timeout: 5m
95+
- when:
96+
condition: <<parameters.test_cljs>>
97+
steps:
98+
- run:
99+
name: karma_test
100+
command: ./bin/run-cljstests
101+
no_output_timeout: 5m
102+
deploy:
103+
executor: tools/clojurecli
104+
steps:
105+
- attach_workspace:
106+
at: /home/circleci
107+
- run:
108+
name: deploy
109+
command: clojure -Sthreads 1 -T:build deploy
110+
release:
111+
executor: tools/clojurecli
112+
steps:
113+
- attach_workspace:
114+
at: /home/circleci
115+
- run:
116+
name: deploy
117+
command: clojure -Sthreads 1 -T:build release
118+
119+
6120
workflows:
7121
build-test-and-deploy:
8122
jobs:
9-
- tools/setup:
123+
- setup:
124+
context: clojars-deploy
10125
setup_cljs: false
11-
context: dockerhub-deploy
12-
- tools/format:
13-
context: dockerhub-deploy
126+
- build:
127+
context: clojars-deploy
128+
build_cljs: false
14129
requires:
15-
- tools/setup
16-
- tools/unittest:
17-
context: dockerhub-deploy
130+
- setup
131+
- tools/format:
132+
context: clojars-deploy
18133
requires:
19-
- tools/setup
20-
- tools/build:
21-
context: dockerhub-deploy
22-
jarname: "superv.async"
134+
- setup
135+
- test:
136+
context: clojars-deploy
137+
test_cljs: false
23138
requires:
24-
- tools/setup
25-
- tools/deploy-snapshot:
26-
jarname: "superv.async"
27-
context:
28-
- clojars-deploy
29-
- dockerhub-deploy
139+
- build
140+
- deploy:
141+
context: clojars-deploy
30142
filters:
31143
branches:
32-
only: development
144+
only: main
33145
requires:
34-
- tools/setup
35146
- tools/format
36-
- tools/unittest
37-
- tools/build
38-
- tools/deploy-release:
39-
jarname: "superv.async"
147+
- test
148+
- release:
40149
context:
41-
- clojars-deploy
42-
- dockerhub-deploy
150+
- github-token
43151
filters:
44152
branches:
45-
only: master
153+
only: main
46154
requires:
47-
- tools/setup
48-
- tools/format
49-
- tools/unittest
50-
- tools/build
155+
- deploy

build.clj

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
(ns build
2+
(:refer-clojure :exclude [test])
3+
(:require [clojure.tools.build.api :as b]
4+
[borkdude.gh-release-artifact :as gh]
5+
[org.corfield.build :as bb]))
6+
7+
(def lib 'io.replikativ/superv.async)
8+
(def version (format "0.3.%s" (b/git-count-revs nil)))
9+
(def class-dir "target/classes")
10+
(def basis (b/create-basis {:project "deps.edn"}))
11+
(def jar-file (format "target/%s-%s.jar" (name lib) version))
12+
13+
(defn clean
14+
[_]
15+
(b/delete {:path "target"}))
16+
17+
(defn jar
18+
[opts]
19+
(-> opts
20+
(assoc :class-dir class-dir
21+
:src-pom "./template/pom.xml"
22+
:lib lib
23+
:version version
24+
:basis basis
25+
:jar-file jar-file
26+
:src-dirs ["src"])
27+
bb/jar))
28+
29+
(defn test "Run the tests." [opts]
30+
(bb/run-tests opts))
31+
32+
(defn ci "Run the CI pipeline of tests (and build the JAR)." [opts]
33+
(-> opts
34+
(assoc :lib lib :version version)
35+
(bb/run-tests)
36+
(bb/clean)
37+
(bb/jar)))
38+
39+
(defn install "Install the JAR locally." [opts]
40+
(-> opts
41+
jar
42+
bb/install))
43+
44+
(defn deploy "Deploy the JAR to Clojars." [opts]
45+
(-> opts
46+
(assoc :lib lib :version version)
47+
(bb/deploy)))
48+
49+
(defn release
50+
[_]
51+
(-> (gh/overwrite-asset {:org "replikativ"
52+
:repo (name lib)
53+
:tag version
54+
:commit (gh/current-commit)
55+
:file jar-file
56+
:content-type "application/java-archive"})
57+
:url
58+
println))

deps.edn

+23-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
{:paths ["src"]
2-
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
3-
org.clojure/clojurescript {:mvn/version "1.10.764"}
4-
org.clojure/core.async {:mvn/version "1.3.610"}}
5-
:aliases {:cljs {:extra-deps {thheller/shadow-cljs {:mvn/version "2.10.21"}
6-
binaryage/devtools {:mvn/version "1.0.2"}}
7-
:extra-paths ["test"]}
8-
:test {:extra-deps {lambdaisland/kaocha {:mvn/version "1.0.641"}}
9-
:extra-paths ["test"]}
10-
:jar {:extra-deps {seancorfield/depstar {:mvn/version "1.1.116"}}
11-
:main-opts ["-m" "hf.depstar.jar" "replikativ-superv-async.jar"]}
12-
:deploy {:extra-deps {deps-deploy/deps-deploy {:mvn/version "0.0.9"}}
13-
:main-opts ["-m" "deps-deploy.deps-deploy" "deploy" "replikativ-superv-async.jar"]}
14-
:format {:extra-deps {cljfmt/cljfmt {:mvn/version "0.7.0"}}
15-
:main-opts ["-m" "cljfmt.main" "check"]}}}
1+
{:paths ["src"]
2+
:deps {org.clojure/clojure {:mvn/version "1.10.3"}
3+
org.clojure/clojurescript {:mvn/version "1.11.4"}
4+
org.clojure/core.async {:mvn/version "1.5.648"}}
5+
:aliases {:cljs {:extra-deps {thheller/shadow-cljs {:mvn/version "2.17.2"}
6+
binaryage/devtools {:mvn/version "1.0.4"}}
7+
:extra-paths ["test"]}
8+
:test {:extra-deps {lambdaisland/kaocha {:mvn/version "1.63.998"}
9+
io.github.cognitect-labs/test-runner {:git/tag "v0.5.0"
10+
:git/sha "48c3c67"}}
11+
:extra-paths ["test"]}
12+
:build {:deps {io.github.seancorfield/build-clj {:git/tag "v0.6.7"
13+
:git/sha "22c2d09"}
14+
borkdude/gh-release-artifact {:git/url "https://github.com/borkdude/gh-release-artifact"
15+
:sha "a83ee8da47d56a80b6380cbb6b4b9274048067bd"}
16+
babashka/babashka.curl {:mvn/version "0.1.1"}
17+
babashka/fs {:mvn/version "0.1.2"}
18+
cheshire/cheshire {:mvn/version "5.10.2"}}
19+
:ns-default build}
20+
:ffix {:extra-deps {cljfmt/cljfmt {:mvn/version "0.8.0"}}
21+
:main-opts ["-m" "cljfmt.main" "fix"]}
22+
:format {:extra-deps {cljfmt/cljfmt {:mvn/version "0.8.0"}}
23+
:main-opts ["-m" "cljfmt.main" "check"]}}}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"ci-test": "npx shadow-cljs compile ci && npx karma start --single-run"
66
},
77
"devDependencies": {
8-
"karma": "^6.3.2",
8+
"karma": "^6.3.15",
99
"karma-chrome-launcher": "^3.1.0",
1010
"karma-cljs-test": "^0.1.0"
1111
},
1212
"dependencies": {
13-
"shadow-cljs": "^2.14.0"
13+
"shadow-cljs": "^2.17.0"
1414
}
1515
}

pom.xml

-36
This file was deleted.

0 commit comments

Comments
 (0)