-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move to deps, upgrade dependencies, configure github actions (#10)
* move to deps, upgrade dependencies, configure github actions
- Loading branch information
1 parent
ffea082
commit 1e4aa7d
Showing
12 changed files
with
163 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: check | ||
|
||
on: [ push ] | ||
|
||
jobs: | ||
clojure: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'corretto' | ||
java-version: '19' | ||
- name: Install clojure tools | ||
uses: DeLaGuardo/[email protected] | ||
with: | ||
cli: latest | ||
- name: Cache clojure dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
~/.gitlibs | ||
~/.deps.clj | ||
key: cljdeps-${{ hashFiles('deps.edn') }} | ||
restore-keys: cljdeps- | ||
- name: Run tests | ||
run: clojure -X:test:run-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ pom.xml.asc | |
.hg/ | ||
.idea/ | ||
*.iml | ||
.cpcache |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(ns build | ||
(:require [clojure.tools.build.api :as b])) | ||
|
||
(def lib 'org.clojars.rutledgepaulv/piped) | ||
(def version "0.1.8") | ||
(def class-dir "target/classes") | ||
(def basis (b/create-basis {:project "deps.edn"})) | ||
(def jar-file (format "target/piped.jar" (name lib) version)) | ||
|
||
(defn get-version [_] | ||
(print version)) | ||
|
||
(defn clean [_] | ||
(b/delete {:path "target"})) | ||
|
||
(defn jar [_] | ||
(b/write-pom {:class-dir class-dir | ||
:lib lib | ||
:version version | ||
:basis basis | ||
:src-dirs ["src"] | ||
:scm {:tag (str "v" version) | ||
:connection (str "scm:git:[email protected]:rutledgepaulv/" (name lib) ".git") | ||
:url (str "https://github.com/rutledgepaulv/" (name lib))}}) | ||
(b/copy-dir {:src-dirs ["src"] :target-dir class-dir}) | ||
(b/jar {:class-dir class-dir :jar-file jar-file})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{:paths ["src" "resources"] | ||
|
||
:deps {org.clojure/clojure {:mvn/version "1.11.1"} | ||
com.cognitect.aws/api {:mvn/version "0.8.686"} | ||
com.cognitect.aws/endpoints {:mvn/version "1.1.12.504"} | ||
com.cognitect.aws/sqs {:mvn/version "847.2.1398.0"} | ||
org.clojure/core.async {:mvn/version "1.6.681"} | ||
org.clojure/tools.logging {:mvn/version "1.2.4"}} | ||
|
||
:aliases | ||
{:build {:extra-deps {io.github.clojure/tools.build | ||
{:git/url "https://github.com/clojure/tools.build.git" | ||
:sha "32d497f4f1ad07cb1dfa0855ada9e9cf17abff48"}} | ||
:extra-paths ["builds"] | ||
:ns-default build} | ||
|
||
:test {:extra-paths ["test"] | ||
:extra-deps {org.testcontainers/testcontainers {:mvn/version "1.19.0"} | ||
org.slf4j/slf4j-simple {:mvn/version "2.0.9"}}} | ||
|
||
:run-tests {:extra-deps {io.github.cognitect-labs/test-runner | ||
{:git/url "https://github.com/cognitect-labs/test-runner.git" | ||
:git/sha "7284cda41fb9edc0f3bc6b6185cfb7138fc8a023"}} | ||
:main-opts ["-m" "cognitect.test-runner"] | ||
:exec-fn cognitect.test-runner.api/test}}} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
clj -X:build clean | ||
clj -X:build jar | ||
version=$(clj -X:build get-version) | ||
|
||
export CLOJARS_USERNAME="op://Personal/clojars.org/username" | ||
export CLOJARS_PASSWORD="op://Personal/clojars.org/token" | ||
|
||
op run -- mvn deploy:deploy-file \ | ||
-DgroupId="org.clojars.rutledgepaulv" \ | ||
-DartifactId="piped" \ | ||
-Dversion="$version" \ | ||
-Dpackaging="jar" \ | ||
-Dfile="target/piped.jar" \ | ||
-DrepositoryId="clojars" \ | ||
-Durl="https://repo.clojars.org" | ||
|
||
git tag "v$version" | ||
git push origin "refs/tags/v$version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,21 @@ | ||
(ns piped.specs-test | ||
(:require | ||
[clojure.spec.alpha :as s] | ||
[clojure.test :refer [deftest is testing]])) | ||
[clojure.spec.alpha :as s] | ||
[clojure.test :refer :all])) | ||
|
||
(deftest specs-test | ||
(testing "processor required fields" | ||
(let [spec {:queue-url "http://queue-url" | ||
:consumer-fn (fn [msg] | ||
(constantly msg) | ||
:ack)}] | ||
(let [spec {:queue-url "http://queue-url" | ||
:consumer-fn (fn [msg] (constantly msg) :ack)}] | ||
(is (s/valid? :piped/options-map spec)) | ||
(is (not (s/valid? :piped/options-map (spec dissoc :queue-url)))) | ||
(is (not (s/valid? :piped/options-map (spec dissoc :consumer-fn)))))) | ||
(testing "action maps" | ||
(let [spec {:action :ack | ||
:delay-seconds 5}] | ||
(let [spec {:action :ack :delay-seconds 5}] | ||
(is (s/valid? :piped/action-map spec)) | ||
(is (s/valid? :piped/action-map | ||
(assoc spec | ||
:action :nack))) | ||
(is (s/valid? :piped/action-map | ||
(dissoc spec | ||
:delay-seconds))) | ||
(is (not (s/valid? :piped/action-map | ||
(assoc spec | ||
:delay-seconds "a")))) | ||
(is (not (s/valid? :piped/action-map | ||
(assoc spec | ||
:delay-seconds -1)))) | ||
(is (not (s/valid? :piped/action-map | ||
(assoc spec | ||
:delay-seconds 1.13)))) | ||
(is (not (s/valid? :piped/action-map | ||
(assoc spec | ||
:action :do-something))))))) | ||
(is (s/valid? :piped/action-map (assoc spec :action :nack))) | ||
(is (s/valid? :piped/action-map (dissoc spec :delay-seconds))) | ||
(is (not (s/valid? :piped/action-map (assoc spec :delay-seconds "a")))) | ||
(is (not (s/valid? :piped/action-map (assoc spec :delay-seconds -1)))) | ||
(is (not (s/valid? :piped/action-map (assoc spec :delay-seconds 1.13)))) | ||
(is (not (s/valid? :piped/action-map (assoc spec :action :do-something))))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters