This repository was archived by the owner on Sep 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
100 lines (84 loc) · 1.63 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.PHONY: all
all:
# when running locally, use the postgres instance from the `docker-compose.yml`
# in this repo
DOCKER_POSTGRES_DATABASE_URL=postgresql://hasura:[email protected]:64001/hasura
.PHONY: ormolu
ormolu:
find src test bench -name '*.hs' | xargs ormolu -ie
.PHONY: format
format:
cabal-fmt -i pg-client.cabal
make ormolu
PROJECT ?= cabal.project
CABAL = cabal --project=$(PROJECT)
.PHONY: freeze
freeze:
$(CABAL) freeze \
--enable-tests \
--enable-benchmarks
.PHONY: configure
configure:
$(CABAL) configure \
--enable-tests \
--enable-benchmarks
.PHONY: update
update:
$(CABAL) update
.PHONY: build-deps
build-deps:
$(CABAL) build \
--only-dependencies \
--enable-tests \
--enable-benchmarks
.PHONY: build
build:
$(CABAL) build \
--enable-tests \
--enable-benchmarks \
pg-client
.PHONY: build-all
build-all:
$(CABAL) build \
--enable-tests \
--enable-benchmarks \
all
.PHONY: start-dbs
start-dbs:
docker-compose up -d
sleep 10
.PHONY: stop-dbs
stop-dbs:
docker-compose down -v
.PHONY: test-ci
test-ci:
$(CABAL) test \
--enable-tests \
--enable-benchmarks \
all
.PHONY: test-all
test-all: start-dbs
export DATABASE_URL=$(DOCKER_POSTGRES_DATABASE_URL) && \
$(CABAL) test \
--enable-tests \
--enable-benchmarks \
all
make stop-dbs
.PHONY: ghcid
ghcid:
ghcid --command "\
$(CABAL) repl \
--repl-option='-fobject-code' \
--repl-option='-O0' \
pg-client \
"
.PHONY: ghcid-test
ghcid-test:
ghcid \
--command "\
$(CABAL) repl \
--repl-option '-fobject-code' \
--repl-option '-O0' \
pg-client-test \
" \
--test ":main"