forked from bitemyapp/esqueleto
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
69 lines (54 loc) · 1.38 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
STACK := stack --jobs $(shell nproc)
match ?=
STACK_TEST_ARGS := $(if $(match),--test-arguments "--match $(match)",)
.PHONY: build
build:
$(STACK) build
.PHONY: build-tests
build-tests:
$(STACK) build --test --no-run-tests
.PHONY: ghci
ghci:
$(STACK) ghci
.PHONY: test
test:
$(STACK) test $(STACK_TEST_ARGS)
# Intended for use in local dev
.PHONY: test-postgresql
test-postgresql: reset-pgsql
$(STACK) test esqueleto:postgresql $(STACK_TEST_ARGS)
.PHONY: test-mysql
test-mysql:
$(STACK) test esqueleto:mysql $(STACK_TEST_ARGS)
.PHONY: test-ghci
test-ghci:
$(STACK) ghci esqueleto:test:sqlite $(STACK_TEST_ARGS)
.PHONY: test-ghcid
test-ghcid:
ghcid -c "$(STACK) ghci --ghci-options -fobject-code esqueleto --test" \
--warnings \
--restart "stack.yaml" \
--restart "esqueleto.cabal" \
--test main
.PHONY: test-ghcid-build
test-ghcid-build:
ghcid -c "$(STACK) ghci --ghci-options -fobject-code esqueleto --test" \
--warnings \
--restart "stack.yaml" \
--restart "esqueleto.cabal"
.PHONY: haddock doc
haddock: doc
doc:
$(STACK) haddock
.PHONY: clean
clean:
$(STACK) clean
.PHONY: init-pgsql
init-pgsql:
sudo -u postgres -- createuser -s esqutest
.PHONY: reset-pgsql
reset-pgsql:
-sudo -u postgres dropdb esqutest
-sudo -u postgres dropuser esqutest
echo "CREATE USER esqutest WITH PASSWORD 'esqutest';" | sudo -u postgres psql
sudo -u postgres createdb -O esqutest esqutest