-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy path.gitlab-ci.yml
80 lines (72 loc) · 1.38 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
image: node:lts-alpine
stages:
- test
- dependencies
- build
- publish
code quality:
stage: test
script:
- npm ci
- npm install --save-dev eslint eslint-formatter-gitlab
- npm run lint -- --format gitlab .
artifacts:
reports:
codequality: gl-codequality.json
test & coverage:
stage: test
script:
- npm ci
- npm i -D jest-junit
- npm test -- --ci --reporters=default --reporters=jest-junit
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
artifacts:
when: always
reports:
junit:
- junit.xml
outdated:
stage: dependencies
script:
- npm outdated
allow_failure: true
security scan:
stage: dependencies
script:
# upgrade the NPM version to the latest to be sure
# the `npm audit` supports the --production flag
- npm i -g npm
- npm audit --production
allow_failure: false
rollup build:
stage: build
script:
- npm ci
- npm run build
artifacts:
paths:
- dist
expire_in: 4 weeks
package:
stage: build
only:
- tags
script:
- npm pack
artifacts:
paths:
- ./*.tgz
publish on npm:
stage: publish
needs:
- package
- rollup build
only:
- tags
- triggers
script:
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- npm publish
environment:
name: npm
url: https://www.npmjs.com/package/@formschema/native