From 43340bcaf67fa27ea62f212450a816bfeaae9ea2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 8 Nov 2019 09:59:07 +0100 Subject: [PATCH] Update .gitlab-ci.yml --- .gitlab-ci.yml | 62 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4dd8cae61..89b201866 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,5 @@ default: image: fpco/stack-build:lts-13.21 - - cache: - key: "${CI_COMMIT_REF_SLUG}" - paths: - - .stack - - .stack-work - - node_modules - - static/bundles variables: STACK_ROOT: "${CI_PROJECT_DIR}/.stack" @@ -19,28 +11,39 @@ stages: - yesod:build - test -container setup: - stage: .pre - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential nodejs chromium-browser - - ln -s $(which g++-7) $(dirname $(which g++-7))/g++ - - npm install -g n - - n stable - npm install: stage: setup script: - npm install - needs: - - container setup + before_script: &npm + - apt-get update + - npm install -g n + - n stable + cache: + key: "${CI_COMMIT_REF_SLUG}" + paths: + - node_modules + artifacts: + paths: + - node_modules/ + name: "${CI_JOB_NAME}" + expire_in: "1 day" frontend:build: stage: frontend:build script: - npm run frontend:build + before_script: + - *npm needs: - npm install + artifacts: + paths: + - static/bundles/ + name: "${CI_JOB_NAME}" + expire_in: "1 day" + dependencies: + - npm install yesod:build:dev: stage: yesod:build @@ -48,10 +51,29 @@ yesod:build:dev: - stack build --copy-bins --local-bin-path $(pwd)/bin --fast --flag uniworx:-library-only --flag uniworx:dev --flag uniworx:pedantic needs: - frontend:build + before_script: + - ln -s $(which g++-7) $(dirname $(which g++-7))/g++ + cache: + key: "${CI_COMMIT_REF_SLUG}" + paths: + - .stack + - .stack_work + artifacts: + paths: + - bin/uniworx + name: "${CI_JOB_NAME}" + expire_in: "1 week" + dependencies: + - frontend:build frontend:test: stage: test script: - npm run frontend:test needs: - - frontend:build \ No newline at end of file + - frontend:build + before_script: + - *npm + - apt-get install -y --no-install-recommends chromium-browser + dependencies: + - npm install \ No newline at end of file