Skip to content

Commit ea6ec1e

Browse files
committed
cleanup/fix snapshot/release GH actions
1 parent 1443998 commit ea6ec1e

File tree

3 files changed

+43
-16
lines changed

3 files changed

+43
-16
lines changed

.github/workflows/test-and-release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ on:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
java: [ '8', '11', '14', '17' ]
1411
steps:
1512
- uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
1615
- uses: actions/setup-java@v2
1716
with:
1817
distribution: 'adopt'
19-
java-version: ${{ matrix.java }}
18+
java-version: '11'
2019
- name: Clojure CLI
2120
uses: DeLaGuardo/setup-clojure@master
2221
with:

.github/workflows/test-and-snapshot.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@ on:
66
- "develop"
77

88
jobs:
9-
build:
9+
build-and-snapshot:
1010
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
java: [ '8', '11', '14', '17' ]
1411
steps:
1512
- uses: actions/checkout@v2
1613
- uses: actions/setup-java@v2
1714
with:
1815
distribution: 'adopt'
19-
java-version: ${{ matrix.java }}
16+
java-version: '11'
2017
- name: Clojure CLI
2118
uses: DeLaGuardo/setup-clojure@master
2219
with:
@@ -37,3 +34,30 @@ jobs:
3734
env:
3835
CLOJARS_PASSWORD: ${{secrets.DEPLOY_TOKEN}}
3936
CLOJARS_USERNAME: ${{secrets.DEPLOY_USERNAME}}
37+
38+
build:
39+
runs-on: ubuntu-latest
40+
strategy:
41+
matrix:
42+
java: [ '8', '14', '17' ]
43+
steps:
44+
- uses: actions/checkout@v2
45+
- uses: actions/setup-java@v2
46+
with:
47+
distribution: 'adopt'
48+
java-version: ${{ matrix.java }}
49+
- name: Clojure CLI
50+
uses: DeLaGuardo/setup-clojure@master
51+
with:
52+
tools-deps: '1.10.3.1053'
53+
- name: Cache All The Things
54+
uses: actions/cache@v2
55+
with:
56+
path: |
57+
~/.m2/repository
58+
~/.gitlibs
59+
~/.clojure
60+
~/.cpcache
61+
key: ${{ runner.os }}-${{ hashFiles('**/deps.edn') }}
62+
- name: Run Tests
63+
run: clojure -T:build test

build.clj

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
For more information, run:
1010
1111
clojure -A:deps -T:build help/doc"
12+
(:refer-clojure :exclude [test])
1213
(:require [clojure.tools.build.api :as b]
1314
[org.corfield.build :as bb]))
1415

@@ -25,20 +26,23 @@
2526
(assoc :main-opts ["-e" ":negative"]))
2627
(bb/run-tests)))
2728

29+
(defn test "Run all the tests." [opts]
30+
(reduce (fn [opts alias]
31+
(run-tests (assoc opts :aliases [alias])))
32+
opts
33+
(cond-> [:1.9 :1.10 :master :humane]
34+
(:cljs opts)
35+
(conj :cljs)))
36+
opts)
37+
2838
(defn ci
2939
"Run the CI pipeline of tests (and build the JAR).
3040
3141
Specify :cljs true to run the ClojureScript tests as well."
3242
[opts]
3343
(-> opts
3444
(assoc :lib lib :version (if (:snapshot opts) snapshot version))
35-
(as-> opts
36-
(reduce (fn [opts alias]
37-
(run-tests (assoc opts :aliases [alias])))
38-
opts
39-
(cond-> [:1.9 :1.10 :master :humane]
40-
(:cljs opts)
41-
(conj :cljs))))
45+
(test)
4246
(bb/clean)
4347
(assoc :src-pom "template/pom.xml")
4448
(bb/jar)))

0 commit comments

Comments
 (0)