GCSBOSS/golog

View on GitHub
.gitlab-ci.yml

Summary

Maintainability
Test Coverage
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 ci .
    - npm run coverage

lint-deno:
 image: denoland/deno:alpine
 stage: test
 tags:
   - docker
 script:
   - cd deno
   - deno lint --unstable

test-deno:
  coverage: '/(\d+\.\d+\%)/'
  image: denoland/deno:alpine
  stage: test
  tags:
    - docker
  script:
    - cd deno
    - deno test --coverage=coverage --unstable --allow-env
    - deno coverage --unstable coverage

# Publish package to NPM.
publish:
  stage: deploy
  image: node
  tags:
    - docker
  only:
    - tags
    - triggers
  except:
    variables:
      - $CI_COMMIT_TAG =~ /beta/
  script:
    - npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
    - npm publish