Skip to content

Commit 581739a

Browse files
committed
add bb, build, deps, gh actions
Signed-off-by: Sean Corfield <[email protected]>
1 parent f7359ec commit 581739a

File tree

9 files changed

+280
-136
lines changed

9 files changed

+280
-136
lines changed

.circleci/config.yml

Lines changed: 0 additions & 135 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release Version
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build-and-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5
13+
with:
14+
fetch-depth: 0
15+
- uses: actions/setup-java@v5
16+
with:
17+
distribution: 'temurin'
18+
java-version: '21'
19+
- name: Setup Clojure
20+
uses: DeLaGuardo/setup-clojure@master
21+
with:
22+
cli: '1.12.2.1565'
23+
bb: 'latest'
24+
- name: Cache All The Things
25+
uses: actions/cache@v4
26+
with:
27+
path: |
28+
~/.m2/repository
29+
~/.gitlibs
30+
~/.clojure
31+
~/.cpcache
32+
~/.deps.clj
33+
key: ${{ runner.os }}-${{ hashFiles('**/deps.edn', '**/bb.edn') }}
34+
- name: Run All Tests, then Build & Deploy Release
35+
run: bb ci:deploy jdk21
36+
env:
37+
CLOJARS_PASSWORD: ${{secrets.DEPLOY_TOKEN}}
38+
CLOJARS_USERNAME: ${{secrets.DEPLOY_USERNAME}}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Develop & Snapshot
2+
3+
on:
4+
push:
5+
branches:
6+
- "develop"
7+
8+
jobs:
9+
build-and-snapshot:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5
13+
- uses: actions/setup-java@v5
14+
with:
15+
distribution: 'temurin'
16+
java-version: '21'
17+
- name: Setup Clojure
18+
uses: DeLaGuardo/setup-clojure@master
19+
with:
20+
cli: '1.12.2.1565'
21+
bb: 'latest'
22+
- name: Cache All The Things
23+
uses: actions/cache@v4
24+
with:
25+
path: |
26+
~/.m2/repository
27+
~/.gitlibs
28+
~/.clojure
29+
~/.cpcache
30+
~/.deps.clj
31+
key: ${{ runner.os }}-${{ hashFiles('**/deps.edn', '**/bb.edn') }}
32+
- name: Run All Tests, then Build & Deploy Snapshot
33+
run: bb ci:deploy snapshot jdk21
34+
env:
35+
CLOJARS_PASSWORD: ${{secrets.DEPLOY_TOKEN}}
36+
CLOJARS_USERNAME: ${{secrets.DEPLOY_USERNAME}}
37+
38+
build:
39+
runs-on: ubuntu-latest
40+
strategy:
41+
matrix:
42+
java: [ '11', '17', '21' ]
43+
steps:
44+
- uses: actions/checkout@v5
45+
- uses: actions/setup-java@v5
46+
with:
47+
distribution: 'temurin'
48+
java-version: ${{ matrix.java }}
49+
- name: Setup Clojure
50+
uses: DeLaGuardo/setup-clojure@master
51+
with:
52+
cli: '1.12.2.1565'
53+
bb: 'latest'
54+
- name: Cache All The Things
55+
uses: actions/cache@v4
56+
with:
57+
path: |
58+
~/.m2/repository
59+
~/.clojure
60+
~/.cpcache
61+
~/.deps.clj
62+
key: ${{ runner.os }}-${{ hashFiles('**/deps.edn', '**/bb.edn') }}
63+
- name: Run Tests
64+
run: bb test jdk${{ matrix.java }}

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Pull Request
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
java: [ '11', '17', '21' ]
11+
steps:
12+
- uses: actions/checkout@v5
13+
- uses: actions/setup-java@v5
14+
with:
15+
distribution: 'temurin'
16+
java-version: ${{ matrix.java }}
17+
- name: Setup Clojure
18+
uses: DeLaGuardo/setup-clojure@master
19+
with:
20+
cli: '1.12.2.1565'
21+
bb: 'latest'
22+
- name: Cache All The Things
23+
uses: actions/cache@v4
24+
with:
25+
path: |
26+
~/.m2/repository
27+
~/.gitlibs
28+
~/.clojure
29+
~/.cpcache
30+
~/.deps.clj
31+
key: ${{ runner.os }}-${{ hashFiles('**/deps.edn', '**/bb.edn') }}
32+
- name: Run All Tests
33+
run: bb test:all jdk${{ matrix.java }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.calva/mcp-server/port
22
.clj-kondo/.cache
3+
.cpcache
34
.DS_Store
45
.idea/
56
.lsp/.cache

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Clojars Project](https://img.shields.io/clojars/v/org.clj-commons/durable-queue.svg)](https://clojars.org/org.clj-commons/durable-queue)
22
[![cljdoc badge](https://cljdoc.org/badge/org.clj-commons/durable-queue)](https://cljdoc.org/d/org.clj-commons/durable-queue)
3-
[![CircleCI](https://circleci.com/gh/clj-commons/durable-queue.svg?style=svg)](https://circleci.com/gh/clj-commons/durable-queue)
3+
[![Clojure CI Release](https://github.com/clj-commons/durable-queue/actions/workflows/test-and-release.yml/badge.svg)](https://github.com/clj-commons/durable-queue/actions/workflows/test-and-release.yml) [![Clojure CI Develop](https://github.com/clj-commons/durable-queue/actions/workflows/test-and-snapshot.yml/badge.svg)](https://github.com/clj-commons/durable-queue/actions/workflows/test-and-snapshot.yml) [![Clojure CI Pull Request](https://github.com/clj-commons/durable-queue/actions/workflows/test.yml/badge.svg)](https://github.com/clj-commons/durable-queue/actions/workflows/test.yml)
44

55
![](docs/EasterIsland.jpg)
66

bb.edn

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{:tasks
2+
{:requires [[clojure.string :as str]]
3+
4+
test {:doc "Run the test suite."
5+
:task
6+
(let [all? (some #{"all"} *command-line-args*) ; test all clojure versions?
7+
bench? (some #{"bench"} *command-line-args*)
8+
stress? (some #{"stress"} *command-line-args*)
9+
versions (or (seq (filter (fn [v] (str/starts-with? v "1."))
10+
*command-line-args*))
11+
["1.10"])
12+
base-jdk (first (filter (fn [v] (str/starts-with? v "jdk"))
13+
*command-line-args*))
14+
jdk (or base-jdk
15+
;; sean's local default:
16+
"jdk24")
17+
test-selectors
18+
(cond bench? ["-i" ":benchmark"]
19+
stress? ["-i" ":stress"]
20+
:else ["-e" ":benchmark"
21+
"-e" ":stress"])]
22+
(doseq [v (if all? ["1.10" "1.11" "1.12"] versions)]
23+
(println "\nTesting Clojure" v)
24+
(apply shell "clojure"
25+
(str "-M"
26+
(str ":" v)
27+
":test:runner"
28+
;; add jdk-specific alias if provided
29+
":" jdk)
30+
test-selectors)))}
31+
32+
test:all {:doc "Run the test suite for all Clojure versions."
33+
:task (binding [*command-line-args* (conj *command-line-args* "all")]
34+
(run 'test))}
35+
36+
-snapshot {:doc "Return snapshot options, if requested."
37+
:task (->> (if (some #{"snapshot"} *command-line-args*)
38+
[:snapshot true]
39+
[])
40+
(map str))}
41+
42+
ci {:doc "Run the CI pipeline of tests and build the JAR."
43+
:depends [test:all]
44+
:task (apply shell "clojure -T:build jar" (run '-snapshot))}
45+
46+
ci:deploy {:doc "Deploy the JAR we just built to Clojars."
47+
:depends [ci]
48+
:task (apply shell "clojure -T:build deploy" (run '-snapshot))}}}

0 commit comments

Comments
 (0)