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 @@ ...@@ -2,7 +2,7 @@
# https://vadosware.io/post/zero-to-continuous-integrated-testing-a-haskell-project-with-gitlab/ # https://vadosware.io/post/zero-to-continuous-integrated-testing-a-haskell-project-with-gitlab/
# #
# #
image: adinapoli/gargantext:v1 image: adinapoli/gargantext:v2
variables: variables:
STACK_ROOT: "${CI_PROJECT_DIR}/.stack-root" STACK_ROOT: "${CI_PROJECT_DIR}/.stack-root"
...@@ -13,13 +13,13 @@ variables: ...@@ -13,13 +13,13 @@ variables:
#- apt-get install make xz-utils #- apt-get install make xz-utils
stages: stages:
- deps - stack
- cabal
- test - test
- docs - docs
- cabal
deps: stack:
stage: deps stage: stack
cache: cache:
# cache per branch name # cache per branch name
# key: ${CI_COMMIT_REF_SLUG} # key: ${CI_COMMIT_REF_SLUG}
...@@ -29,7 +29,7 @@ deps: ...@@ -29,7 +29,7 @@ deps:
- target - target
script: script:
- echo "Building the project from '$CI_PROJECT_DIR'" - 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: docs:
stage: docs stage: docs
...@@ -41,7 +41,7 @@ docs: ...@@ -41,7 +41,7 @@ docs:
- .stack-work/ - .stack-work/
- target - target
script: 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 - cp -R "$(stack path --local-install-root)"/doc ./output
artifacts: artifacts:
paths: paths:
...@@ -49,23 +49,22 @@ docs: ...@@ -49,23 +49,22 @@ docs:
expire_in: 1 week expire_in: 1 week
allow_failure: true allow_failure: true
test: cabal:
stage: test stage: cabal
cache: cache:
# cache per branch name # cache per branch name
# key: ${CI_COMMIT_REF_SLUG} # key: ${CI_COMMIT_REF_SLUG}
paths: paths:
- .stack-root/ - .stack-root/
- .stack-work/ - .stack-work/
- dist-newstyle/
- target - target
script: script:
- nix-shell --run "stack test --no-terminal --fast" - nix-shell --run "./bin/update-cabal-project && cabal v2-build"
allow_failure: false
# TOOO
cabal: test:
# FIXME(adinapoli) A temporary hack until we switch to cabal 3.10.1.0 properly stage: test
stage: cabal
cache: cache:
# cache per branch name # cache per branch name
# key: ${CI_COMMIT_REF_SLUG} # key: ${CI_COMMIT_REF_SLUG}
...@@ -75,6 +74,5 @@ cabal: ...@@ -75,6 +74,5 @@ cabal:
- dist-newstyle/ - dist-newstyle/
- target - target
script: script:
- nix-shell --run "./bin/update-cabal-project && cabal v2-build --dry-run" - nix-shell --run "cabal v2-test --test-show-details=streaming"
allow_failure: false
...@@ -4,9 +4,16 @@ ARG DEBIAN_FRONTEND=noninteractive ...@@ -4,9 +4,16 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG GHC=8.10.7 ARG GHC=8.10.7
ARG STACK=2.7.3 ARG STACK=2.7.3
ARG CABAL=3.10.1.0 ARG CABAL=3.10.1.0
COPY ./shell.nix /builds/gargantext/shell.nix COPY ./shell.nix /builds/gargantext/shell.nix
COPY ./nix/pkgs.nix /builds/gargantext/nix/pkgs.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/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 ENV TZ=Europe/Rome
RUN apt-get update && \ RUN apt-get update && \
...@@ -61,19 +68,7 @@ ENV PATH=/root/.nix-profile/bin:$PATH ...@@ -61,19 +68,7 @@ ENV PATH=/root/.nix-profile/bin:$PATH
RUN . $HOME/.bashrc && nix-env --version 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 ENV PATH=/root/.local/bin:$PATH
RUN cd /builds/gargantext && nix-shell 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/" 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