diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9136c0eb0..21c42ee02 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,22 +1,51 @@ default: image: fpco/stack-build:lts-13.21 - before_script: - - apt-get install -y --no-install-recommends build-essential - - ln -s $(which g++-7) $(dirname $(which g++-7))/g++ + cache: + key: "${CI_COMMIT_REF_SLUG}" + paths: + - .stack + - .stack-work + variables: STACK_ROOT: "${CI_PROJECT_DIR}/.stack" -cache: - key: "${CI_COMMIT_REF_SLUG}" - paths: - - .stack - - .stack-work - -build: - stage: build +stages: + - setup + - frontend:build + - yesod:build + - test + +container setup: + stage: .pre script: - - stack build --copy-bins --local-bin-path $(pwd) --flag uniworx:-library-only --flag uniworx:-dev --flag uniworx:pedantic - artifacts: - paths: - - uniworx \ No newline at end of file + - apt-get install -y --no-install-recommends build-essential nodejs chromium + - ln -s $(which g++-7) $(dirname $(which g++-7))/g++ + +npm install: + stage: setup + script: + - npm install + needs: + - container setup + +frontend:build: + stage: frontend:build + script: + - npm run frontend:build + needs: + - npm install + +yesod:build:dev: + stage: yesod:build + script: + - stack build --copy-bins --local-bin-path $(pwd)/bin --fast --flag uniworx:-library-only --flag uniworx:dev --flag uniworx:pedantic + needs: + - frontend:build + +frontend:test: + stage: test + script: + - npm run frontend:test + needs: + - frontend:build \ No newline at end of file