-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
129 lines (118 loc) · 2.88 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
include:
- template: Dependency-Scanning.gitlab-ci.yml
- template: SAST.gitlab-ci.yml
- template: Code-Quality.gitlab-ci.yml
- template: License-Scanning.gitlab-ci.yml
stages:
- test
- build
- testing
- post-test
- publish
Build Latest:
cache:
key: node_modules-latest
paths:
- node_modules/
image: node:latest
stage: build
needs: []
script:
- npm ci
- npm install -g typescript
- tsc
artifacts:
paths:
- dist/
Test Latest API:
stage: testing
needs: ['Build Latest']
image: node:latest
before_script:
- npm install -g nyc
- npm ci
script:
- nyc --silent npm run test:API --reporter mocha-junit-reporter
artifacts:
reports:
junit: test-results.xml
expire_in: 60s
paths:
- .nyc_output/
- dist/
Test Latest Options:
stage: testing
needs: ['Build Latest']
image: node:latest
before_script:
- npm install -g nyc
- npm ci
script:
- nyc --silent npm run test:Startup --reporter mocha-junit-reporter
artifacts:
reports:
junit: test-results.xml
expire_in: 60s
paths:
- .nyc_output/
Coverage Latest:
stage: post-test
needs: ['Test Latest Options', 'Test Latest API']
image: node:latest
before_script:
- npm install -g nyc
script:
- nyc report --reporter text
Build LTS:
extends: 'Build Latest'
cache:
key: node_modules-lts
image: node:lts
Test LTS API:
extends: 'Test Latest API'
image: node:lts
needs: ['Build LTS']
Test LTS Options:
extends: 'Test Latest Options'
image: node:lts
needs: ['Build LTS']
Coverage LTS:
stage: post-test
needs: ['Test LTS Options', 'Test LTS API']
image: node:lts
before_script:
- npm install -g nyc
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- nyc report --reporter text --reporter cobertura --reporter lcov
- ./cc-test-reporter after-build --exit-code 0
artifacts:
reports:
cobertura: coverage/cobertura-coverage.xml
Lint:
stage: post-test
needs: ['Build Latest', 'Build LTS']
image: node:lts
before_script:
- npm ci
script:
- npx prettier --check .
Publish:
stage: publish
needs:
[
'Test LTS Options',
'Test LTS API',
'Test Latest Options',
'Test Latest API',
'Lint',
]
image: node:lts
before_script:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
script:
- npm publish
only:
- tags