image: node:alpine
stages:
- prepare
- test
services:
- postgres:latest
cache:
untracked: true
key: $CI_COMMIT_REF_SLUG
paths:
- node_modules/
variables:
POSTGRES_DB: "letu"
POSTGRES_USER: "letu"
POSTGRES_PASSWORD: "letu"
POSTGRES_HOST_AUTH_METHOD: trust
NODE_ENV: "test"
install_requirements:
stage: prepare
script:
- apk add --no-cache python make g++
- npm config set registry http://registry.npmjs.org/
- npm install
artifacts:
tests:
stage: test
- npm test