]> Git — Sourcephile - gargantext.git/blob - .gitlab-ci.yml
Do not ignore gargantext.cabal
[gargantext.git] / .gitlab-ci.yml
1 # Thanks to:
2 # https://vadosware.io/post/zero-to-continuous-integrated-testing-a-haskell-project-with-gitlab/
3 #
4 #
5 image: adinapoli/gargantext:v1
6
7 variables:
8 STACK_ROOT: "${CI_PROJECT_DIR}/.stack-root"
9 STACK_OPTS: "--system-ghc"
10
11 #before_script:
12 #- apt-get update
13 #- apt-get install make xz-utils
14
15 stages:
16 - deps
17 - test
18 - docs
19 - cabal
20
21 deps:
22 stage: deps
23 cache:
24 # cache per branch name
25 # key: ${CI_COMMIT_REF_SLUG}
26 paths:
27 - .stack-root/
28 - .stack-work/
29 - target
30 script:
31 - echo "Building the project from '$CI_PROJECT_DIR'"
32 - nix-shell --run "LC_ALL=C.UTF-8 stack build --no-terminal --haddock --no-haddock-deps --only-dependencies --fast"
33
34 docs:
35 stage: docs
36 cache:
37 # cache per branch name
38 # key: ${CI_COMMIT_REF_SLUG}
39 paths:
40 - .stack-root/
41 - .stack-work/
42 - target
43 script:
44 - nix-shell --run "LC_ALL=C.UTF-8 stack build --no-terminal --haddock --no-haddock-deps --fast"
45 - cp -R "$(stack path --local-install-root)"/doc ./output
46 artifacts:
47 paths:
48 - ./output
49 expire_in: 1 week
50 allow_failure: true
51
52 test:
53 stage: test
54 cache:
55 # cache per branch name
56 # key: ${CI_COMMIT_REF_SLUG}
57 paths:
58 - .stack-root/
59 - .stack-work/
60 - target
61 script:
62 - nix-shell --run "stack test --no-terminal --fast"
63
64 # TOOO
65
66 cabal:
67 # FIXME(adinapoli) A temporary hack until we switch to cabal 3.10.1.0 properly
68 stage: cabal
69 cache:
70 # cache per branch name
71 # key: ${CI_COMMIT_REF_SLUG}
72 paths:
73 - .stack-root/
74 - .stack-work/
75 - dist-newstyle/
76 - target
77 script:
78 - nix-shell --run "./bin/update-cabal-project && cabal v2-build --dry-run"
79 allow_failure: false
80