-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
44 lines (40 loc) · 1.14 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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'
before_script:
- apt-get update -y && apt-get install -y fonts-urw-base35 gsfonts fonts-dejavu
script:
- 'npm install'
- 'npm install jest -g'
- 'cp configs/secrets.js.example configs/secrets.js'
- 'jest --ci --verbose --reporters=default --reporters=jest-junit --testPathIgnorePatterns=./test/ --collectCoverage --coverageReporters text --coverageReporters cobertura'
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
artifacts:
when: always
reports:
junit:
- junit.xml
coverage_report:
coverage_format: cobertura
path: coverage/cobertura-coverage.xml
#TODO: stage: integration-tests