Compare commits

...

6 commits

Author SHA1 Message Date
Eddú Meléndez Gonzales
802f18af55
Update GHA versions (#80)
* actions/setup-java@v4
* actions/cache@v4
* actions/checkout@v4
2024-04-16 07:53:09 -05:00
Tim Zöller
1297054b77 Updated dependency versions 2024-04-13 09:32:57 +02:00
Tim Zöller
233c3883eb
Make config clearer in log-strategies.md (#73) (#77)
This wasn't working for me because nothing in here says it all needs to be the value a `:log-to` key in the container config map. Reading the code and adding that made it work. Figured it might be nice to clarify that for others too.

Co-authored-by: Wes Morgan <github@wesmorgan.me>
2024-04-13 09:08:45 +02:00
Ukpono Nnah
49f547585e
tutorial.md: Fix let bindings (#75)
Fix let bindings uneven form
2024-04-13 09:06:01 +02:00
Eddú Meléndez
874d5756af
Update branch to main 2023-08-24 15:57:19 -06:00
Eddú Meléndez Gonzales
9bf75d6387
Add release workflow (#70) 2023-08-24 14:47:48 -06:00
7 changed files with 87 additions and 34 deletions

18
.github/actions/setup-build/action.yml vendored Normal file
View 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

View file

@ -2,18 +2,21 @@ name: Clojure CI
on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: lein deps
- name: Run tests
run: lein test
- uses: actions/checkout@v4
- name: Setup Build
uses: ./.github/actions/setup-build
- name: Install dependencies
run: lein deps
- name: Run tests
run: lein test

28
.github/workflows/release.yml vendored Normal file
View 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 }}

View file

@ -1,27 +1,27 @@
{:paths ["src" "resources"]
: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"}
:test {:extra-paths ["test" "test/resources"]
: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-junit-xml {:mvn/version "1.17.101"}
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"]
: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-junit-xml {:mvn/version "1.17.101"}
org.clojure/test.check {:mvn/version "1.1.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"]}
:cljstyle {:extra-deps {mvxcvi/cljstyle {:mvn/version "0.15.0"
:cljstyle {:extra-deps {mvxcvi/cljstyle {:mvn/version "0.16.630"
:exclusions [org.clojure/clojure]}}
:main-opts ["-m" "cljstyle.main" "check"]}}}

View file

@ -4,13 +4,13 @@ This library offers two ways to access the logs of the running container: The :s
## 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.
Example:
```clojure
{:log-strategy :string}
{:log-to {:log-strategy :string}}
```
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:
```clojure
{:log-strategy :fn
:function (fn [log-line] (println "From Container: " log-line))}
```
{:log-to {:log-strategy :fn
:function (fn [log-line] (println "From Container: " log-line))}}
```

View file

@ -89,10 +89,10 @@ atom, a fixture for Testcontainers could look like this:
```clojure
(use-fixtures :once (fn [f]
(let [{pw "apassword"
postgres (tc/start! (tc/create {:image-name "postgres:12.2"
:exposed-ports [5432]
:env-vars {"POSTGRES_PASSWORD" pw}}))}]
(let [pw "apassword"
postgres (tc/start! (tc/create {:image-name "postgres:12.2"
:exposed-ports [5432]
:env-vars {"POSTGRES_PASSWORD" pw}}))]
(my-app/initialize-db! {:dbtype "postgresql"
:dbname "postgres"
:user "postgres"

View file

@ -1,13 +1,13 @@
(defproject clj-test-containers "0.7.4"
:description "A lightweight, unofficial wrapper around the Testcontainers Java library"
(defproject testcontainers-clj "unspecified"
: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"
:url "http://www.eclipse.org/legal/epl-v10.html"}
: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"]
"cljstyle" ["run" "-m" "cljstyle.main"]}
@ -15,16 +15,20 @@
:plugins [[jainsahab/lein-githooks "1.0.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-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"]
[orchestra "2021.01.01-1"]
[org.clojure/tools.namespace "1.3.0"]
[org.testcontainers/postgresql "1.19.0"]
[com.fzakaria/slf4j-timbre "0.3.21"]
[org.clojure/tools.namespace "1.5.0"]
[org.testcontainers/postgresql "1.19.7"]
[com.fzakaria/slf4j-timbre "0.4.1"]
[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")