.gitlab-ci.yml
stages:
- test
- deploy
include:
- template: Dependency-Scanning.gitlab-ci.yml
- template: SAST.gitlab-ci.yml
- template: Code-Quality.gitlab-ci.yml
sast:
variables:
SAST_EXCLUDED_PATHS: test/**
code_quality:
rules:
- if: '$CI_COMMIT_TAG'
when: never
lint-node:
image: node
stage: test
tags:
- docker
script:
- npm install -g eslint
- eslint --ignore-pattern "**/*.min.js" "$CI_PROJECT_DIR/lib"
test-node:
coverage: '/Statements\s*:\s*(\d+(?:\.\d+)?\%)/'
image: registry.gitlab.com/gcsboss/docker-mocha-nyc:0.1.0-alpine
stage: test
artifacts:
paths: [coverage]
tags:
- docker
script:
- npm i -P --no-optional .
- npm run coverage
lint-deno:
image: hayd/ubuntu-deno:1.6.2
stage: test
tags:
- docker
script:
- cd deno
- deno lint --unstable --ignore=test.js
test-deno:
coverage: '/(\d+\.\d+\%)/'
image: hayd/ubuntu-deno:1.6.2
stage: test
tags:
- docker
script:
- cd deno
- deno test --allow-read --allow-write --coverage --unstable
# Publish package to NPM
publish:
stage: deploy
image: node
tags:
- docker
only:
- tags
- triggers
except:
variables:
- $CI_COMMIT_TAG =~ /beta/
script:
- npm install -g npm-cli-login
- npm-cli-login
- npm publish