Compare commits
6 commits
release_ac
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
802f18af55 | ||
|
|
1297054b77 | ||
|
|
233c3883eb | ||
|
|
49f547585e | ||
|
|
874d5756af | ||
|
|
9bf75d6387 |
7 changed files with 87 additions and 34 deletions
18
.github/actions/setup-build/action.yml
vendored
Normal file
18
.github/actions/setup-build/action.yml
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
name: Set up Build
|
||||||
|
description: Sets up Build
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '8'
|
||||||
|
distribution: temurin
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.m2/repository
|
||||||
|
key: ${{ runner.os }}-lein-${{ hashFiles('**/project.clj') }}
|
||||||
|
restore-keys: ${{ runner.os }}-lein-
|
||||||
|
- name: Clear existing docker image cache
|
||||||
|
shell: bash
|
||||||
|
run: docker image prune -af
|
||||||
21
.github/workflows/clojure.yml
vendored
21
.github/workflows/clojure.yml
vendored
|
|
@ -2,18 +2,21 @@ name: Clojure CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: Install dependencies
|
- name: Setup Build
|
||||||
run: lein deps
|
uses: ./.github/actions/setup-build
|
||||||
- name: Run tests
|
- name: Install dependencies
|
||||||
run: lein test
|
run: lein deps
|
||||||
|
- name: Run tests
|
||||||
|
run: lein test
|
||||||
|
|
|
||||||
28
.github/workflows/release.yml
vendored
Normal file
28
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Setup Build
|
||||||
|
uses: ./.github/actions/setup-build
|
||||||
|
- name: Set version
|
||||||
|
run: |
|
||||||
|
lein change version set '"${{github.event.release.tag_name}}"'
|
||||||
|
- name: Release ${{github.event.release.tag_name}}
|
||||||
|
run: lein with-profile release deploy maven
|
||||||
|
env:
|
||||||
|
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
||||||
|
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
|
||||||
12
deps.edn
12
deps.edn
|
|
@ -1,27 +1,27 @@
|
||||||
{:paths ["src" "resources"]
|
{:paths ["src" "resources"]
|
||||||
|
|
||||||
:deps {org.clojure/clojure {:mvn/version "1.10.3"}
|
:deps {org.clojure/clojure {:mvn/version "1.10.3"}
|
||||||
org.testcontainers/testcontainers {:mvn/version "1.17.6"}}
|
org.testcontainers/testcontainers {:mvn/version "1.19.7"}}
|
||||||
|
|
||||||
:aliases {:dev {:extra-paths "dev-src"}
|
:aliases {:dev {:extra-paths "dev-src"}
|
||||||
:test {:extra-paths ["test" "test/resources"]
|
:test {:extra-paths ["test" "test/resources"]
|
||||||
:extra-deps {expound/expound {:mvn/version "0.9.0"}
|
:extra-deps {expound/expound {:mvn/version "0.9.0"}
|
||||||
lambdaisland/kaocha {:mvn/version "1.71.1119"}
|
lambdaisland/kaocha {:mvn/version "1.88.1376"}
|
||||||
lambdaisland/kaocha-cloverage {:mvn/version "1.1.89"}
|
lambdaisland/kaocha-cloverage {:mvn/version "1.1.89"}
|
||||||
lambdaisland/kaocha-junit-xml {:mvn/version "1.17.101"}
|
lambdaisland/kaocha-junit-xml {:mvn/version "1.17.101"}
|
||||||
org.clojure/test.check {:mvn/version "1.1.1"}
|
org.clojure/test.check {:mvn/version "1.1.1"}
|
||||||
org.testcontainers/postgresql {:mvn/version "1.17.6"}}}
|
org.testcontainers/postgresql {:mvn/version "1.19.7"}}}
|
||||||
|
|
||||||
:test-runner {:extra-paths ["test" "test/resources"]
|
:test-runner {:extra-paths ["test" "test/resources"]
|
||||||
:extra-deps {expound/expound {:mvn/version "0.9.0"}
|
:extra-deps {expound/expound {:mvn/version "0.9.0"}
|
||||||
lambdaisland/kaocha {:mvn/version "1.71.1119"}
|
lambdaisland/kaocha {:mvn/version "1.88.1376"}
|
||||||
lambdaisland/kaocha-cloverage {:mvn/version "1.1.89"}
|
lambdaisland/kaocha-cloverage {:mvn/version "1.1.89"}
|
||||||
lambdaisland/kaocha-junit-xml {:mvn/version "1.17.101"}
|
lambdaisland/kaocha-junit-xml {:mvn/version "1.17.101"}
|
||||||
org.clojure/test.check {:mvn/version "1.1.1"}
|
org.clojure/test.check {:mvn/version "1.1.1"}
|
||||||
orchestra {:mvn/version "2021.01.01-1"}
|
orchestra {:mvn/version "2021.01.01-1"}
|
||||||
org.testcontainers/postgresql {:mvn/version "1.17.6"}}
|
org.testcontainers/postgresql {:mvn/version "1.19.7"}}
|
||||||
:main-opts ["-m" "kaocha.runner" "--reporter" "kaocha.report/documentation"]}
|
:main-opts ["-m" "kaocha.runner" "--reporter" "kaocha.report/documentation"]}
|
||||||
|
|
||||||
:cljstyle {:extra-deps {mvxcvi/cljstyle {:mvn/version "0.15.0"
|
:cljstyle {:extra-deps {mvxcvi/cljstyle {:mvn/version "0.16.630"
|
||||||
:exclusions [org.clojure/clojure]}}
|
:exclusions [org.clojure/clojure]}}
|
||||||
:main-opts ["-m" "cljstyle.main" "check"]}}}
|
:main-opts ["-m" "cljstyle.main" "check"]}}}
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,13 @@ This library offers two ways to access the logs of the running container: The :s
|
||||||
|
|
||||||
## String Strategy
|
## String Strategy
|
||||||
|
|
||||||
The `:string` strategy sets up a function in the returned map, under the `string-log` key. This function enables the
|
The `:string` strategy sets up a function in the returned map, under the `:log` key. This function enables the
|
||||||
dumping of the logs when passed to the `dump-logs` function.
|
dumping of the logs when passed to the `dump-logs` function.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
{:log-strategy :string}
|
{:log-to {:log-strategy :string}}
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, later in your program, you can access the logs thus:
|
Then, later in your program, you can access the logs thus:
|
||||||
|
|
@ -29,6 +29,6 @@ This way you can pass the container logging on to the logging library of your ch
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
{:log-strategy :fn
|
{:log-to {:log-strategy :fn
|
||||||
:function (fn [log-line] (println "From Container: " log-line))}
|
:function (fn [log-line] (println "From Container: " log-line))}}
|
||||||
```
|
```
|
||||||
|
|
@ -89,10 +89,10 @@ atom, a fixture for Testcontainers could look like this:
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
(use-fixtures :once (fn [f]
|
(use-fixtures :once (fn [f]
|
||||||
(let [{pw "apassword"
|
(let [pw "apassword"
|
||||||
postgres (tc/start! (tc/create {:image-name "postgres:12.2"
|
postgres (tc/start! (tc/create {:image-name "postgres:12.2"
|
||||||
:exposed-ports [5432]
|
:exposed-ports [5432]
|
||||||
:env-vars {"POSTGRES_PASSWORD" pw}}))}]
|
:env-vars {"POSTGRES_PASSWORD" pw}}))]
|
||||||
(my-app/initialize-db! {:dbtype "postgresql"
|
(my-app/initialize-db! {:dbtype "postgresql"
|
||||||
:dbname "postgres"
|
:dbname "postgres"
|
||||||
:user "postgres"
|
:user "postgres"
|
||||||
|
|
|
||||||
24
project.clj
24
project.clj
|
|
@ -1,13 +1,13 @@
|
||||||
(defproject clj-test-containers "0.7.4"
|
(defproject testcontainers-clj "unspecified"
|
||||||
:description "A lightweight, unofficial wrapper around the Testcontainers Java library"
|
:description "A lightweight, official wrapper around the Testcontainers Java library"
|
||||||
|
|
||||||
:url "https://github.com/javahippie/clj-test-containers"
|
:url "https://github.com/testcontainers/testcontainers-clj"
|
||||||
|
|
||||||
:license {:name "Eclipse Public License"
|
:license {:name "Eclipse Public License"
|
||||||
:url "http://www.eclipse.org/legal/epl-v10.html"}
|
:url "http://www.eclipse.org/legal/epl-v10.html"}
|
||||||
|
|
||||||
:dependencies [[org.clojure/clojure "1.10.3"]
|
:dependencies [[org.clojure/clojure "1.10.3"]
|
||||||
[org.testcontainers/testcontainers "1.19.0"]]
|
[org.testcontainers/testcontainers "1.19.7"]]
|
||||||
|
|
||||||
:aliases {"test" ["run" "-m" "kaocha.runner"]
|
:aliases {"test" ["run" "-m" "kaocha.runner"]
|
||||||
"cljstyle" ["run" "-m" "cljstyle.main"]}
|
"cljstyle" ["run" "-m" "cljstyle.main"]}
|
||||||
|
|
@ -15,16 +15,20 @@
|
||||||
:plugins [[jainsahab/lein-githooks "1.0.0"]]
|
:plugins [[jainsahab/lein-githooks "1.0.0"]]
|
||||||
|
|
||||||
:profiles {:dev {:dependencies [[expound "0.9.0"]
|
:profiles {:dev {:dependencies [[expound "0.9.0"]
|
||||||
[lambdaisland/kaocha "1.85.1342"]
|
[lambdaisland/kaocha "1.88.1376"]
|
||||||
[lambdaisland/kaocha-cloverage "1.1.89"]
|
[lambdaisland/kaocha-cloverage "1.1.89"]
|
||||||
[lambdaisland/kaocha-junit-xml "1.17.101"]
|
[lambdaisland/kaocha-junit-xml "1.17.101"]
|
||||||
[mvxcvi/cljstyle "0.15.0" :exclusions [org.clojure/clojure]]
|
[mvxcvi/cljstyle "0.16.630" :exclusions [org.clojure/clojure]]
|
||||||
[org.clojure/test.check "1.1.1"]
|
[org.clojure/test.check "1.1.1"]
|
||||||
[orchestra "2021.01.01-1"]
|
[orchestra "2021.01.01-1"]
|
||||||
[org.clojure/tools.namespace "1.3.0"]
|
[org.clojure/tools.namespace "1.5.0"]
|
||||||
[org.testcontainers/postgresql "1.19.0"]
|
[org.testcontainers/postgresql "1.19.7"]
|
||||||
[com.fzakaria/slf4j-timbre "0.3.21"]
|
[com.fzakaria/slf4j-timbre "0.4.1"]
|
||||||
[nrepl "1.0.0"]]
|
[nrepl "1.0.0"]]
|
||||||
:source-paths ["dev-src"]}}
|
:source-paths ["dev-src"]}
|
||||||
|
:release {:deploy-repositories [["maven" {:url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
|
||||||
|
:username :env/ossrh_username
|
||||||
|
:password :env/ossrh_password
|
||||||
|
:sign-releases false}]]}}
|
||||||
|
|
||||||
:target-path "target/%s")
|
:target-path "target/%s")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue