Skip to content

Commit

Permalink
cljfmt, project setup for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
caioaao committed Jun 22, 2020
1 parent 977c57e commit 1d88263
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 12 deletions.
83 changes: 83 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,83 @@
version: 2

jobs:
build-and-test:
docker:
- image: circleci/clojure:lein-2.8.1
steps:
- checkout
- restore_cache:
key: deps-{{ checksum "project.clj" }}
- run:
command: |
lein deps
- save_cache:
key: deps-{{ checksum "project.clj" }}
paths:
- "~/.m2"
# - run:
# command: |
# lein test

lint:
docker:
- image: circleci/clojure:lein-2.8.1
steps:
- checkout
- restore_cache:
key: deps-{{ checksum "project.clj" }}
- run:
command: |
lein deps
- save_cache:
key: deps-{{ checksum "project.clj" }}
paths:
- "~/.m2"
- run:
command: |
lein cljfmt check
deploy:
docker:
- image: circleci/clojure:lein-2.8.1
steps:
- checkout
- restore_cache:
key: deps-{{ checksum "project.clj" }}
- run:
name: deps
command: |
lein deps
- save_cache:
key: deps-{{ checksum "project.clj" }}
paths:
- "~/.m2"
- run:
name: run deploy
command: |
git config credential.helper 'cache --timeout=120'
git config user.email "caioaao@gmail.com"
git config user.name CircleCI
lein release
workflows:
version: 2
build-test-and-deploy:
jobs:
- build-and-test:
filters:
tags:
only: /.*/
- lint:
filters:
tags:
only: /.*/
- deploy:
requires:
- build-and-test
- lint
filters:
tags:
only: /[0-9]+(\.[0-9]+)*(-(alpha|beta)[0-9]*)?/
branches:
ignore: /.*/
19 changes: 15 additions & 4 deletions project.clj
@@ -1,12 +1,23 @@
(defproject cats.spec "0.1.0-SNAPSHOT"
(defproject com.caioaao/cats.spec "0.1.0"
:description "specs for funcool cats monads"
:url "http://github.com/caioaao/cats.spec"
:license {:name "BSD (2 Clause)"
:license {:name "BSD (2 Clause)"
:url "http://opensource.org/licenses/BSD-2-Clause"}
:dependencies [[org.clojure/clojure "1.9.0-alpha16" :scope "provided"]
:manifest {"GIT_COMMIT" ~(System/getenv "GIT_COMMIT")
"BUILD_NUMBER" ~(System/getenv "BUILD_NUMBER")}
:scm "https://github.com/caioaao/tank"
:dependencies [[org.clojure/clojure "1.10.0" :scope "provided"]
[org.clojure/clojurescript "1.9.521" :scope "provided"]
[org.clojure/spec.alpha "0.1.94" :scope "provided"]
[org.clojure/test.check "0.9.0" :scope "provided"]
[funcool/cats "2.0.0" :scope "provided"]]
:profiles {:dev {:dependencies []
:plugins [[lein-cljfmt "0.6.7"]]
:global-vars {*warn-on-reflection* true}}}
:source-paths ["src"]
:test-paths ["test"])
:test-paths ["test"]
:release-tasks [["deploy" "clojars"]]
:deploy-repositories [["clojars" {:url "https://clojars.org/repo"
:sign-releases false
:username :env/clojars_username
:password :env/clojars_password}]])
2 changes: 1 addition & 1 deletion src/cats/spec/monad/exception.cljc
Expand Up @@ -75,4 +75,4 @@

(defmacro exception
[pred-success pred-failure]
`(exception-impl '~pred-success ~pred-success '~pred-failure ~pred-failure))
`(exception-impl '~pred-success ~pred-success '~pred-failure ~pred-failure))
2 changes: 1 addition & 1 deletion src/cats/spec/monad/identity.cljc
Expand Up @@ -36,7 +36,7 @@
(if (not (identity? x))
{:path path :pred `identity? :val x :via via :in in}
(s/explain* @spec (conj path :identity/self)
via in @x)))
via in @x)))

(gen* [this overrides path rmap]
(if-let [gfn (:gfn this)]
Expand Down
1 change: 0 additions & 1 deletion test/cats/spec/monad/either_test.cljc
Expand Up @@ -27,7 +27,6 @@

(s/def :either/move-or-error (s.either/either :either.move/move :either.move/error))


(t/deftest either-spec-test
(t/testing "Works with clojure.spec api"
(doseq [v (gen/sample (s/gen :either/move-or-error))]
Expand Down
10 changes: 5 additions & 5 deletions test/cats/spec/monad/exception_test.cljc
@@ -1,11 +1,11 @@
(ns cats.spec.monad.exception-test
#?@(:clj
[(:require [cats.spec.monad.exception :as s.exc]
[clojure.test :as t]
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[cats.monad.exception :as m.exc]
[cats.protocols :as p])]
[clojure.test :as t]
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[cats.monad.exception :as m.exc]
[cats.protocols :as p])]

:cljs
[(:require [cats.monad.exception :as m.exc]
Expand Down

0 comments on commit 1d88263

Please sign in to comment.