• Przemyslaw Kaminski's avatar
    [ci] add "deps" step · 320ade0f
    Przemyslaw Kaminski authored
    This is to add an initial step for the CI so that, hopefully, it will
    cache deps and next step (docs and tests) will be faster.
    320ade0f
This GitLab CI configuration is valid. Learn more
.gitlab-ci.yml 1.2 KB
# Thanks to:
# https://vadosware.io/post/zero-to-continuous-integrated-testing-a-haskell-project-with-gitlab/
#
#
image: cgenie/stack-build:lts-18.18-garg
#image: cgenie/nixos-stack:latest

variables:
  STACK_ROOT: "${CI_PROJECT_DIR}/.stack-root"
  STACK_OPTS: "--system-ghc"

#before_script:
  #- apt-get update
  #- apt-get install make xz-utils

stages:
  - deps
  - docs
  - test

deps:
  cache:
    # cache per branch name
    # key: ${CI_COMMIT_REF_SLUG}
    paths:
      - .stack
      - .stack-root/
      - .stack-work/
      - target
  script:
    - stack build --no-terminal --haddock --no-haddock-deps --only-dependencies --fast

docs:
  cache:
    # cache per branch name
    # key: ${CI_COMMIT_REF_SLUG}
    paths:
      - .stack
      - .stack-root/
      - .stack-work/
      - target
  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
      - .stack-root/
      - .stack-work/
      - target
  script:
    - stack test --no-terminal --fast

      # TOOO