Skip to content

Commit ed58366

Browse files
committed
unify ci/ and hack/ under bass/
previously, ci/ was for things "run by ci" and hack/ was for things "run by devs". ci/ would typically prefer to start with a SHA and fetch a reproducible input, while hack/ would always run with host paths. with the last slew of changes it's pretty easy to unify them so they take a `src` value on stdin, which can be easily passed with -i src=./ during dev.
1 parent c3995af commit ed58366

File tree

18 files changed

+62
-85
lines changed

18 files changed

+62
-85
lines changed

bass/actions

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bass
2+
3+
(defn main []
4+
(for [{sha :sha} *stdin*]
5+
(use (*dir*/../project))
6+
(let [repo (project:checkout sha)]
7+
(run (*dir*/test {:src repo}))
8+
(run (*dir*/nix-check {:src repo})))))

bass/build

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bass
2+
3+
(defn main []
4+
(for [{src (:src *dir*/../)
5+
version (:version "dev")
6+
os (:os "linux")
7+
arch (:arch "amd64")} *stdin*]
8+
(use (src/project))
9+
10+
(log "building and smoke-testing %s" src)
11+
(let [dist (project:build src version os arch)]
12+
(project:smoke-test dist)
13+
(emit dist *stdout*))))

bass/docs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bass
2+
3+
(defn main []
4+
(for [{src (:src *dir*/../)
5+
version (:version "dev")
6+
os (:os "linux")
7+
arch (:arch "amd64")} *stdin*]
8+
(use (src/project))
9+
(emit (project:docs src) *stdout*)))

bass/nix-check

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bass
2+
3+
(defn main testflags
4+
(for [{src (:src *dir*/../)} *stdin*]
5+
(use (src/project))
6+
(log "running nix-check")
7+
(run (project:nix-checks src))))

ci/shipit renamed to bass/shipit

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
(use (*dir*/../project)
55
(.strings))
66

7+
; builds and publishes a GitHub release
8+
;
9+
; Needs the tag to checkout, build, and publish along with a title for the
10+
; release.
11+
(defn main [sha tag title]
12+
(let [src (project:checkout sha)
13+
release-url (create-release src sha tag title)]
14+
(logf "release published to %s" release-url)))
15+
716
; all supported os and architectures supported by bass
817
;
918
; Must be valid values to pass to GOOS / GOARCH.
@@ -76,12 +85,3 @@
7685
:draft draft
7786
:prerelease pre?
7887
:discussion-category (if (or draft pre?) null "General"))))
79-
80-
; builds and publishes a GitHub release
81-
;
82-
; Needs the tag to checkout, build, and publish along with a title for the
83-
; release.
84-
(defn main [sha tag title]
85-
(let [src (project:checkout sha)
86-
release-url (create-release src sha tag title)]
87-
(logf "release published to %s" release-url)))

bass/test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bass
2+
3+
(defn main testflags
4+
(for [{src (:src *dir*/../)} *stdin*]
5+
(use (src/project))
6+
(log "running tests")
7+
(run (project:tests src ["./..." & testflags]))))

ci/build

Lines changed: 0 additions & 8 deletions
This file was deleted.

ci/check

Lines changed: 0 additions & 11 deletions
This file was deleted.

ci/nix-check

Lines changed: 0 additions & 6 deletions
This file was deleted.

ci/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -e -u -x
44

55
cd $(dirname $0)/..
66

7-
nix develop -c ./hack/with-deps ./ci/check $GITHUB_SHA
7+
nix develop -c ./hack/with-deps ./bass/actions -i sha=$GITHUB_SHA

0 commit comments

Comments
 (0)