174 lines
3.6 KiB
YAML
174 lines
3.6 KiB
YAML
default:
|
|
image: fpco/stack-build:lts-13.21
|
|
|
|
services:
|
|
- postgres:latest
|
|
|
|
variables:
|
|
STACK_ROOT: "${CI_PROJECT_DIR}/.stack"
|
|
CHROME_BIN: "/usr/bin/chromium-browser"
|
|
POSTGRES_DB: uniworx_test
|
|
POSTGRES_USER: uniworx
|
|
POSTGRES_PASSWORD: uniworx
|
|
PGHOST: postgres
|
|
|
|
stages:
|
|
- setup
|
|
- frontend:build
|
|
- yesod:build
|
|
- lint
|
|
- test
|
|
|
|
npm install:
|
|
stage: setup
|
|
script:
|
|
- npm install
|
|
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
|
|
|
|
frontend:lint:
|
|
stage: lint
|
|
script:
|
|
- npm run frontend:lint
|
|
before_script: *npm
|
|
needs:
|
|
- npm install
|
|
dependencies:
|
|
- 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
|
|
before_script:
|
|
- apt-get update
|
|
- apt-get install -y --no-install-recommends locales-all
|
|
- ln -s $(which g++-7) $(dirname $(which g++-7))/g++
|
|
cache:
|
|
key: "${CI_COMMIT_REF_SLUG}"
|
|
paths:
|
|
- .stack
|
|
- .stack-work
|
|
artifacts:
|
|
paths:
|
|
- bin/
|
|
name: "${CI_JOB_NAME}"
|
|
expire_in: "1 week"
|
|
dependencies:
|
|
- frontend:build
|
|
|
|
only:
|
|
- '${CI_COMMIT_REF_SLUG} !~ /^v[0-9].*/'
|
|
|
|
yesod:build:
|
|
stage: yesod:build
|
|
script:
|
|
- stack build --copy-bins --local-bin-path $(pwd)/bin --flag uniworx:-library-only --flag uniworx:-dev --flag uniworx:pedantic
|
|
needs:
|
|
- frontend:build
|
|
before_script:
|
|
- apt-get update
|
|
- apt-get install -y --no-install-recommends locales-all
|
|
- ln -s $(which g++-7) $(dirname $(which g++-7))/g++
|
|
cache:
|
|
key: "${CI_COMMIT_REF_SLUG}"
|
|
paths:
|
|
- .stack
|
|
- .stack-work
|
|
artifacts:
|
|
paths:
|
|
- bin/
|
|
name: "${CI_JOB_NAME}"
|
|
dependencies:
|
|
- frontend:build
|
|
|
|
only:
|
|
- '${CI_COMMIT_REF_SLUG} =~ /^v[0-9].*/'
|
|
|
|
frontend:test:
|
|
stage: test
|
|
script:
|
|
- npm run frontend:test
|
|
needs:
|
|
- npm install
|
|
before_script:
|
|
- apt-get update
|
|
- npm install -g n
|
|
- n stable
|
|
- apt-get install -y --no-install-recommends chromium-browser
|
|
dependencies:
|
|
- npm install
|
|
|
|
hlint:dev:
|
|
stage: lint
|
|
script:
|
|
- stack test --fast --flag uniworx:-library-only --flag uniworx:dev --flag uniworx:pedantic uniworx:test:hlint
|
|
needs:
|
|
- frontend:build
|
|
- yesod:build:dev # For caching
|
|
before_script:
|
|
- apt-get update
|
|
- apt-get install -y --no-install-recommends locales-all
|
|
- ln -s $(which g++-7) $(dirname $(which g++-7))/g++
|
|
dependencies:
|
|
- frontend:build
|
|
cache:
|
|
key: "${CI_COMMIT_REF_SLUG}"
|
|
paths:
|
|
- .stack
|
|
- .stack-work
|
|
|
|
only:
|
|
- '${CI_COMMIT_REF_SLUG} !~ /^v[0-9].*/'
|
|
|
|
yesod:test:dev:
|
|
stage: test
|
|
script:
|
|
- stack test --coverage --fast --flag uniworx:-library-only --flag uniworx:-dev --flag uniworx:pedantic --skip hlint
|
|
needs:
|
|
- frontend:build
|
|
- yesod:build:dev # For caching
|
|
before_script:
|
|
- apt-get update
|
|
- apt-get install -y --no-install-recommends locales-all
|
|
- ln -s $(which g++-7) $(dirname $(which g++-7))/g++
|
|
dependencies:
|
|
- frontend:build
|
|
cache:
|
|
key: "${CI_COMMIT_REF_SLUG}"
|
|
paths:
|
|
- .stack
|
|
- .stack-work
|
|
|
|
only:
|
|
- '${CI_COMMIT_REF_SLUG} !~ /^v[0-9].*/'
|
|
|