Update .gitlab-ci.yml

This commit is contained in:
Gregor Kleen 2019-11-08 09:59:07 +01:00
parent 2979e40f21
commit 43340bcaf6

View File

@ -1,13 +1,5 @@
default: default:
image: fpco/stack-build:lts-13.21 image: fpco/stack-build:lts-13.21
cache:
key: "${CI_COMMIT_REF_SLUG}"
paths:
- .stack
- .stack-work
- node_modules
- static/bundles
variables: variables:
STACK_ROOT: "${CI_PROJECT_DIR}/.stack" STACK_ROOT: "${CI_PROJECT_DIR}/.stack"
@ -19,28 +11,39 @@ stages:
- yesod:build - yesod:build
- test - 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: npm install:
stage: setup stage: setup
script: script:
- npm install - npm install
needs: before_script: &npm
- container setup - 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: frontend:build:
stage: frontend:build stage: frontend:build
script: script:
- npm run frontend:build - npm run frontend:build
before_script:
- *npm
needs: needs:
- npm install - npm install
artifacts:
paths:
- static/bundles/
name: "${CI_JOB_NAME}"
expire_in: "1 day"
dependencies:
- npm install
yesod:build:dev: yesod:build:dev:
stage: yesod:build 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 - stack build --copy-bins --local-bin-path $(pwd)/bin --fast --flag uniworx:-library-only --flag uniworx:dev --flag uniworx:pedantic
needs: needs:
- frontend:build - 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: frontend:test:
stage: test stage: test
script: script:
- npm run frontend:test - npm run frontend:test
needs: needs:
- frontend:build - frontend:build
before_script:
- *npm
- apt-get install -y --no-install-recommends chromium-browser
dependencies:
- npm install