-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
73 lines (64 loc) · 1.37 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
image: node:13.0.1-alpine
stages:
- install
- check
- compile
- test
- analysis
cache: &global_cache
key: '$CI_COMMIT_REF_NAME'
paths:
- node_modules/
- dist/
policy: pull-push
install:
stage: install
script:
- npm ci --verbose
cache:
<<: *global_cache
policy: push
check:
stage: check
script:
- npm run lint
cache:
<<: *global_cache
policy: pull
compile:
stage: compile
script:
- npm run tsc -- --version
- npm run tsc
dependencies:
- install
test:
stage: test
script:
- npm run test
cache:
<<: *global_cache
policy: pull
.sonarqube-base:
stage: analysis
image: emundo/docker-compose-openjdk-node-sonarqube-scanner:latest
retry:
max: 2
when: runner_system_failure
allow_failure: true
dependencies:
- compile
sonar-job-master:
extends:
- .sonarqube-base
script:
- npm run sonar-scanner
only:
- master
sonar-preview:
extends:
- .sonarqube-base
script:
- node_modules/sonarqube-scanner/dist/bin/sonar-scanner -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
only:
- merge_requests