Commit 5f1732ab authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Update CI and docker image

parent 807dc262
Pipeline #4324 failed with stages
in 101 minutes and 56 seconds
......@@ -2,7 +2,7 @@
# https://vadosware.io/post/zero-to-continuous-integrated-testing-a-haskell-project-with-gitlab/
#
#
image: adinapoli/gargantext:v1
image: adinapoli/gargantext:v2
variables:
STACK_ROOT: "${CI_PROJECT_DIR}/.stack-root"
......@@ -13,13 +13,13 @@ variables:
#- apt-get install make xz-utils
stages:
- deps
- stack
- cabal
- test
- docs
- cabal
deps:
stage: deps
stack:
stage: stack
cache:
# cache per branch name
# key: ${CI_COMMIT_REF_SLUG}
......@@ -29,7 +29,7 @@ deps:
- target
script:
- echo "Building the project from '$CI_PROJECT_DIR'"
- nix-shell --run "LC_ALL=C.UTF-8 stack build --no-terminal --haddock --no-haddock-deps --only-dependencies --fast"
- nix-shell --run "stack build --no-terminal --haddock --no-haddock-deps --only-dependencies --fast --dry-run"
docs:
stage: docs
......@@ -41,7 +41,7 @@ docs:
- .stack-work/
- target
script:
- nix-shell --run "LC_ALL=C.UTF-8 stack build --no-terminal --haddock --no-haddock-deps --fast"
- nix-shell --run "stack build --no-terminal --haddock --no-haddock-deps --fast --dry-run"
- cp -R "$(stack path --local-install-root)"/doc ./output
artifacts:
paths:
......@@ -49,23 +49,22 @@ docs:
expire_in: 1 week
allow_failure: true
test:
stage: test
cabal:
stage: cabal
cache:
# cache per branch name
# key: ${CI_COMMIT_REF_SLUG}
paths:
- .stack-root/
- .stack-work/
- dist-newstyle/
- target
script:
- nix-shell --run "stack test --no-terminal --fast"
# TOOO
- nix-shell --run "./bin/update-cabal-project && cabal v2-build"
allow_failure: false
cabal:
# FIXME(adinapoli) A temporary hack until we switch to cabal 3.10.1.0 properly
stage: cabal
test:
stage: test
cache:
# cache per branch name
# key: ${CI_COMMIT_REF_SLUG}
......@@ -75,6 +74,5 @@ cabal:
- dist-newstyle/
- target
script:
- nix-shell --run "./bin/update-cabal-project && cabal v2-build --dry-run"
allow_failure: false
- nix-shell --run "cabal v2-test --test-show-details=streaming"
......@@ -4,9 +4,16 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG GHC=8.10.7
ARG STACK=2.7.3
ARG CABAL=3.10.1.0
COPY ./shell.nix /builds/gargantext/shell.nix
COPY ./nix/pkgs.nix /builds/gargantext/nix/pkgs.nix
COPY ./nix/pinned-22.05.nix /builds/gargantext/nix/pinned-22.05.nix
COPY ./shell.nix /builds/gargantext/shell.nix
COPY ./nix/pkgs.nix /builds/gargantext/nix/pkgs.nix
COPY ./nix/pinned-22.05.nix /builds/gargantext/nix/pinned-22.05.nix
COPY ./nix/overlays/Cabal-3.10.1.0.nix /builds/gargantext/nix/overlays/Cabal-3.10.1.0.nix
COPY ./nix/overlays/cabal-install-3.10.1.0.nix /builds/gargantext/nix/overlays/cabal-install-3.10.1.0.nix
COPY ./nix/overlays/cabal-install-solver-3.10.1.0.nix /builds/gargantext/nix/overlays/cabal-install-solver-3.10.1.0.nix
COPY ./nix/overlays/Cabal-syntax-3.10.1.0.nix /builds/gargantext/nix/overlays/Cabal-syntax-3.10.1.0.nix
COPY ./nix/overlays/directory-1.3.7.0.nix /builds/gargantext/nix/overlays/directory-1.3.7.0.nix
COPY ./nix/overlays/hackage-security-0.6.2.3.nix /builds/gargantext/nix/overlays/hackage-security-0.6.2.3.nix
COPY ./nix/overlays/process-1.6.15.0.nix /builds/gargantext/nix/overlays/process-1.6.15.0.nix
ENV TZ=Europe/Rome
RUN apt-get update && \
......@@ -61,19 +68,7 @@ ENV PATH=/root/.nix-profile/bin:$PATH
RUN . $HOME/.bashrc && nix-env --version
RUN \
curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > /usr/bin/ghcup && \
chmod +x /usr/bin/ghcup && \
ghcup config set gpg-setting GPGLax && \
ghcup -v install ghc --force ${GHC} && \
ghcup -v install cabal --force ${CABAL} && \
ghcup -v install stack --force ${STACK}
ENV PATH=/root/.ghcup/bin:$PATH
ENV PATH=/root/.local/bin:$PATH
RUN cd /builds/gargantext && nix-shell
RUN ghcup set 8.10.7 && cabal v2-update && cabal v2-install hpack --overwrite-policy=always
WORKDIR "/builds/gargantext/"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment