2020-12-23 18:36:41 +01:00
|
|
|
image: node:latest
|
|
|
|
|
|
|
|
stages:
|
2020-12-23 20:15:28 +01:00
|
|
|
- Preparation
|
|
|
|
- Build
|
|
|
|
- Test
|
2020-12-23 18:36:41 +01:00
|
|
|
|
2020-12-23 20:15:28 +01:00
|
|
|
Install Dependencies:
|
|
|
|
stage: Preparation
|
|
|
|
cache:
|
|
|
|
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
|
|
|
|
paths:
|
|
|
|
- node_modules/
|
2020-12-23 20:07:28 +01:00
|
|
|
script:
|
2020-12-23 20:15:28 +01:00
|
|
|
- npm ci
|
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- package-lock.json
|
2020-12-23 18:36:41 +01:00
|
|
|
|
2020-12-23 20:15:28 +01:00
|
|
|
Build:
|
|
|
|
stage: Build
|
|
|
|
cache:
|
|
|
|
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
|
|
|
|
paths:
|
|
|
|
- node_modules/
|
|
|
|
policy: pull
|
2020-12-23 20:07:28 +01:00
|
|
|
script:
|
|
|
|
- npm run build
|
2020-12-23 20:15:28 +01:00
|
|
|
|
|
|
|
Lint:
|
|
|
|
stage: Test
|
|
|
|
cache:
|
|
|
|
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
|
|
|
|
paths:
|
|
|
|
- node_modules/
|
2020-12-23 20:16:40 +01:00
|
|
|
policy: pull
|
2020-12-23 20:15:28 +01:00
|
|
|
script:
|
|
|
|
- npm run lint
|
|
|
|
# Test:
|
|
|
|
# stage: Test
|
|
|
|
# cache:
|
|
|
|
# key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
|
|
|
|
# paths:
|
|
|
|
# - node_modules/
|
2020-12-23 20:16:40 +01:00
|
|
|
# policy: pull
|
2020-12-23 20:07:28 +01:00
|
|
|
# script:
|
|
|
|
# - npm test
|