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
# Thanks to:
# https://vadosware.io/post/zero-to-continuous-integrated-testing-a-haskell-project-with-gitlab/
#
#
image: cgenie/stack-build:lts-17.13-garg
variables:
STACK_ROOT: "${CI_PROJECT_DIR}/.stack-root"
STACK_OPTS: "--system-ghc"
#before_script:
#- apt-get update
#- apt-get install make xz-utils
stages:
- docs
- test
docs:
cache:
# cache per branch name
# key: ${CI_COMMIT_REF_SLUG}
paths:
- .stack-root/
- .stack-work/
script:
- stack build --no-terminal --haddock --no-haddock-deps --fast
- cp -R "$(stack path --local-install-root)"/doc ./output
artifacts:
paths:
- ./output
expire_in: 1 week
test:
cache:
# cache per branch name
# key: ${CI_COMMIT_REF_SLUG}
paths:
- .stack-root/
- .stack-work/
script:
- stack test --no-terminal --fast
# TOOO
#unit-test:
# stage: test
# script:
# - make test-unit
#
#int-test:
# stage: test
# script:
# - make test-int
#
#e2e-test:
# stage: test
# script:
# - make test-e2e
#
# If you find yourself with a non-sensical build error when you know your project should be building just fine, this fragment should help:
#
#build:
# stage: build
# script:
# # Clear out cache files
# - rm -rf .stack
# - rm -rf .stack-work
# - stack setup --system-ghc
# - stack install --local-bin-path target --system-ghc