Set up Gitlab CI

This commit is contained in:
Lucas Verney 2018-11-29 17:25:13 +01:00
parent b097387825
commit 57a7761330

44
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,44 @@
# Note: We use --silent argument on yarn invocations to keep the output simple
# and readable through email notifications.
image: node:8
cache:
key: 'node-modules-cyclassist'
paths:
- node_modules/
- yarn.lock
stages:
- lint # Check code syntax and coding style
- build # Try to build Kresus code
- test # Run unit tests
# Lint and check last commit in a dedicated task
lint:
stage: lint
before_script:
- yarn install
script:
# Lint JS code
- yarn run --silent lint
# Build the server and client code in dev and production
build:
stage: build
before_script:
- yarn install
script:
# Check everything builds correctly
- yarn run --silent build
cache:
policy: pull
# Run tests
test:
stage: test
before_script:
- yarn install
script:
- yarn run --silent test
cache:
policy: pull