-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
60 lines (48 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
default: all
all: bdcs-api-server
sandbox:
# Delete the sandbox if it already exists - The build-and-test target mounts
# the source directory into the container. If a sandbox already exists, it
# can result in some pretty bizarre errors when trying to install deps.
-if [ -z "$$TRAVIS" ] && [ -d .cabal-sandbox ]; then \
rm -r .cabal-sandbox cabal.sandbox.config; \
fi
cabal clean
cabal sandbox init
bdcs-api-server: sandbox
cabal update
cabal install --dependencies-only --reorder-goals --force-reinstalls
cabal configure
cabal build
clean:
cabal clean
hlint:
if [ -z "$$(which hlint)" ]; then \
echo hlint not found in PATH - install it; \
exit 1; \
else \
hlint .; \
fi
tests: sandbox
cabal update
cabal install --dependencies-only --enable-tests --reorder-goals --force-reinstalls
cabal configure --enable-tests --enable-coverage
cabal build
cabal test --show-details=always
build-and-test: Dockerfile.build
sudo docker build -t welder/bdcs-api-build-img -f $< .
sudo docker run --rm --security-opt label=disable -v `pwd`:/bdcs-api/ welder/bdcs-api-build-img
bdcs-api-img: build-and-test
sudo docker build -t welder/bdcs-api-img .
ci: bdcs-api-img
ci_after_success:
sudo docker run --rm --security-opt label=disable -v `pwd`:/bdcs-api/ \
--env "TRAVIS=$$TRAVIS" --env "TRAVIS_JOB_ID=$$TRAVIS_JOB_ID" --entrypoint /usr/bin/make welder/bdcs-api-build-img coveralls
coveralls:
if [ -z "$$(which hpc-coveralls)" ]; then \
echo hpc-coveralls not found in PATH - install it; \
exit 1; \
else \
hpc-coveralls --display-report spec; \
fi
.PHONY: sandbox bdcs-api-server clean tests hlint ci ci_after_success coveralls