mirror of https://gitgud.io/fatchan/jschan.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
839 B
39 lines
839 B
image: node:latest
|
|
|
|
# Cache modules in between jobs
|
|
cache:
|
|
key: $CI_COMMIT_REF_SLUG
|
|
paths:
|
|
- .npm/
|
|
|
|
before_script:
|
|
- npm ci --cache .npm --prefer-offline
|
|
|
|
# Code linting
|
|
eslint:
|
|
stage: .pre
|
|
rules:
|
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
script:
|
|
- 'npm i -g eslint-cli'
|
|
- 'npm i eslint --save-dev'
|
|
- 'node node_modules/eslint/bin/eslint.js ./'
|
|
allow_failure: true
|
|
|
|
# Run tests
|
|
unit-tests:
|
|
stage: test
|
|
rules:
|
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
script:
|
|
- 'npm install'
|
|
- 'npm install jest -g'
|
|
- 'cp configs/secrets.js.example configs/secrets.js'
|
|
- 'jest --ci --reporters=default --reporters=jest-junit --testPathIgnorePatterns=./test/'
|
|
artifacts:
|
|
when: always
|
|
reports:
|
|
junit:
|
|
- junit.xml
|
|
|
|
#TODO: stage: integration-tests
|
|
|