Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use deps #204

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 10 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ references:
base_config: &base_config
working_directory: ~/elo
docker:
- image: circleci/clojure:lein-2.8.1
- image: circleci/clojure:tools-deps-1.9.0.391

base_docker: &base_docker
working_directory: ~/elo
docker:
- image: circleci/clojure:lein-2.8.1
- image: circleci/clojure:tools-deps-1.9.0.391
environment:
DATABASE_URL: postgres://elo@localhost/elo_test

Expand All @@ -25,20 +25,20 @@ jobs:
- checkout
- restore_cache:
keys:
- clj-deps-{{ checksum "project.clj" }}
- clj-deps-{{ checksum "deps.edn" }}

- run: lein cljfmt check
- run: lein eastwood
- run: clojure -A:cljfmt
- run: clojure -A:eastwood

test_clj:
<<: *base_docker
steps:
- checkout
- restore_cache:
keys:
- clj-deps-{{ checksum "project.clj" }}
- clj-deps-{{ checksum "deps.edn" }}

- run: lein migratus migrate
- run: bin/migrate
- run: bin/kaocha --plugin kaocha.plugin/junit-xml --junit-xml-file test-results/kaocha/results.xml
- store_test_results:
path: test-results
Expand All @@ -48,28 +48,17 @@ jobs:
- ~/.m2/repository
- ~/.lein

key: clj-deps-{{ checksum "project.clj" }}

test_cljs:
<<: *base_docker
steps:
- checkout
- run: sudo apt install rhino
- restore_cache:
keys:
- clj-deps-{{ checksum "project.clj" }}

- run: lein test-cljs || true
key: clj-deps-{{ checksum "deps.edn" }}

coverage_clj:
<<: *base_docker
steps:
- checkout
- restore_cache:
keys:
- clj-deps-{{ checksum "project.clj" }}
- clj-deps-{{ checksum "deps.edn" }}

- run: lein migratus migrate
- run: bin/migrate
- run: bin/kaocha --plugin cloverage --codecov

- store_artifacts:
Expand All @@ -83,7 +72,6 @@ workflows:
version: 2
build:
jobs:
- test_cljs
- test_clj
- coverage_clj
- cljfmt
2 changes: 1 addition & 1 deletion bin/kaocha
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

lein kaocha "$@"
clojure -A:kaocha "$@"
3 changes: 3 additions & 0 deletions bin/migrate
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

clojure -m byf.migrate
79 changes: 79 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{:paths ["src/clj" "src/cljc"]
:aliases
{:eastwood {:extra-deps {jonase/eastwood {:mvn/version "RELEASE"}}
:main-opts ["-m" "eastwood.lint" "{:source-paths,[\"src\"],:test-paths,[\"test\"]}"]}

:graph {:extra-deps {org.clojure/tools.deps.graph {:mvn/version "0.2.24"}}
:main-opts ["-m" "clojure.tools.deps.graph"]}

:cljfmt {:extra-deps {cljfmt {:mvn/version "0.6.4"}}
:main-opts ["-m" "cljfmt.main" "check"]}

:carve {:extra-deps {borkdude/carve {:git/url "https://github.com/borkdude/carve"
:sha "f9a4bc98d79ac61e9c52c99bdeadfaa67cf2e63f"}}
:main-opts ["-m" "carve.main"]}

:kaocha {:extra-deps {lambdaisland/kaocha {:mvn/version "0.0-590"}
lambdaisland/kaocha-cloverage {:mvn/version "0.0-32"}
lambdaisland/kaocha-junit-xml {:mvn/version "0.0-70"}}
:extra-paths ["test/cljc" "test/clj"]
:main-opts ["-m" "kaocha.runner"]}}

:deps {org.clojure/clojure {:mvn/version "1.10.1"},
cljsjs/moment {:mvn/version "2.24.0-0"},
metosin/ring-http-response {:mvn/version "0.9.1"},
ns-tracker {:mvn/version "0.4.0"},
day8.re-frame/tracing-stubs {:mvn/version "0.5.3"},
org.clojure/spec.alpha {:mvn/version "0.2.176"},
com.cemerick/url {:mvn/version "0.1.1"},
org.clojure/tools.cli {:mvn/version "0.4.2"},
com.bhauman/figwheel-main {:mvn/version "0.2.3"},
day8.re-frame/http-fx {:mvn/version "0.1.6"},
cljs-http {:mvn/version "0.1.46"},
integrant/repl {:mvn/version "0.3.1"},
bidi {:mvn/version "2.1.6"},
prone {:mvn/version "2019-07-08"},
cljsjs/react-dom {:mvn/version "16.9.0-0"},
ring/ring-defaults {:mvn/version "0.3.2"},
org.clojure/clojurescript {:mvn/version "1.10.520"},
aero {:mvn/version "1.1.3"},
ring/ring-json {:mvn/version "0.5.0"},
medley {:mvn/version "1.2.0"},
aysylu/loom {:mvn/version "1.0.2"},
environ/environ.core {:mvn/version "0.3.1"},
org.postgresql/postgresql {:mvn/version "42.2.8"},
datascript {:mvn/version "0.18.5"},
reagent-utils {:mvn/version "0.3.3"},
http-kit {:mvn/version "2.3.0"},
ring {:mvn/version "1.7.1"},
buddy {:mvn/version "2.0.0"},
cljsjs/react {:mvn/version "16.9.0-0"},
nilenso/honeysql-postgres {:mvn/version "0.2.6"},
cljs-ajax {:mvn/version "0.8.0"},
cljsjs/vega {:mvn/version "5.4.0-0"},
org.webjars/font-awesome {:mvn/version "5.10.1"},
antizer {:mvn/version "0.3.1"},
com.taoensso/sente {:mvn/version "1.14.0-RC2"},
org.clojure/data.csv {:mvn/version "0.1.4"},
com.taoensso/timbre {:mvn/version "4.10.0"},
org.clojure/java.jdbc {:mvn/version "0.7.10"},
hiccup {:mvn/version "1.0.5"},
integrant {:mvn/version "0.7.0"},
migratus {:mvn/version "1.0.9"},
junit/junit {:mvn/version "4.12"},
com.andrewmcveigh/cljs-time {:mvn/version "0.5.2"},
venantius/accountant {:mvn/version "0.2.4"},
org.clojure/tools.reader {:mvn/version "1.3.2"},
clj-http {:mvn/version "3.10.0"},
cljsjs/vega-lite {:mvn/version "3.4.0-0"},
buddy/buddy-auth {:mvn/version "2.2.0"},
reifyhealth/specmonstah {:mvn/version "2.0.0-alpha-1"},
expound {:mvn/version "0.7.2"},
org.clojure/test.check {:mvn/version "0.10.0"},
ring-cljsjs {:mvn/version "0.2.0"},
lambdaisland/uri {:mvn/version "1.2.1"},
bk/ring-gzip {:mvn/version "0.3.0"},
ring/ring-mock {:mvn/version "0.4.0"},
honeysql {:mvn/version "0.9.8"},
re-frame {:mvn/version "0.10.9"},
ring-oauth2 {:mvn/version "0.1.4"}}}
9 changes: 1 addition & 8 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
:aliases {"fig" ["trampoline" "run" "-m" "figwheel.main"]
"fig:build" ["trampoline" "run" "-m" "figwheel.main" "-b" "dev"]
"cljs-prod" ["run" "-m" "figwheel.main" "--build-once" "prod"]
"test-cljs" ["doo" "rhino" "test" "once"]
"kaocha" ["with-profile" "+kaocha" "run" "-m" "kaocha.runner"]
"seed" ["run" "-m" "byf.seed"]}

Expand Down Expand Up @@ -142,13 +141,7 @@
[ring/ring-mock "0.4.0"]]}}
:cljsbuild
{:builds
[{:id "test"
:source-paths ["src/cljs" "src/cljc" "test/cljs" "test/cljc"]
:compiler {:output-to "target/unit-test.js"
:main 'byf.runner
:optimizations :whitespace}}

{:id "min"
[{:id "min"
:source-paths ["src/cljs" "src/cljc"]
:compiler {:main byf.core
:output-to "resources/public/cljs-out/dev-main.js"
Expand Down
4 changes: 2 additions & 2 deletions setup_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dropdb --if-exists $DEV; createdb $DEV

dropdb --if-exists $TEST; createdb $TEST

DATABASE_URL="postgres://byf@localhost:5445/byf" lein migratus migrate
DATABASE_URL="postgres://byf@localhost:5445/byf_test" lein migratus migrate
DATABASE_URL="postgres://byf@localhost:5445/byf" bin/migrate
DATABASE_URL="postgres://byf@localhost:5445/byf_test" bin/migrate

DATABASE_URL="postgres://byf@localhost:5445/byf" lein run -m byf.seed
14 changes: 14 additions & 0 deletions src/clj/byf/migrate.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(ns byf.migrate
(:gen-class)
(:require [migratus.core :as migratus]
[byf.config :refer [value]]))

(defn config
[]
{:store :database
:migration-dir "resources/migrations"
:db (value :database-url)})

(defn -main
[& args]
(migratus/migrate (config)))
15 changes: 0 additions & 15 deletions test/cljs/byf/common/handlers_test.cljs

This file was deleted.

11 changes: 0 additions & 11 deletions test/cljs/byf/runner.cljs

This file was deleted.