Commit d3941362 authored by Yannick Li's avatar Yannick Li
Browse files

Setup CI

parent 50a0f44f
Pipeline #241994 canceled with stage
stages:
- collaborative-pipeline
collaborative:
stage: collaborative-pipeline
trigger:
include: collaborative/.gitlab-ci.yml
strategy: depend
only:
changes:
- collaborative/**/*
image: node:14.16.0
stages:
- build
- test
cache: &global_cache # per-branch cache
key: ${CI_COMMIT_REF_SLUG}
paths:
- collaborative/.npm/
# make push explicit
policy: pull
build:
stage: build
before_script:
- cd collaborative
script:
- npm ci --cache .npm --prefer-offline
# prepare script is skipped by install/ci when running NPM 6 as root.
# This line can be safely removed with NPM 7+ (see NPM Changelog)
- npm run prepare
# Build demo application
# Still some ESlint warnings to be fixed: disable ESlint at this stage
- DISABLE_ESLINT_PLUGIN=true npm run build
artifacts:
paths:
- collaborative/node_modules/
- collaborative/build/
expire_in: 3 days
cache:
<<: *global_cache
policy: pull-push
test:
stage: test
# node 15+ has bug #2143 : https://github.com/npm/cli/issues/2143
image: node:14.16.0
variables:
COUCHDB_HOST: couchdb
COUCHDB_PORT: 5984
COUCHDB_URL: http://$COUCHDB_HOST:$COUCHDB_PORT/
COUCHDB_USER: admin
COUCHDB_PASSWORD: "admin"
services:
- couchdb:latest
before_script:
- cd collaborative
# setup couchdb
- curl -su "$COUCHDB_USER:$COUCHDB_PASSWORD"
-X PUT $COUCHDB_URL/_users
# run c-service in background
- npx @concordant/c-service &
script:
- npm test
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
artifacts:
paths:
- coverage/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment