/
.gitlab-ci.yml
73 lines (64 loc) · 1.04 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:14
cache: &global_cache
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
- dist/
# All jobs, by default, can only pull the cache
policy: pull
stages:
- install
- test
- deploy
install deps:
stage: install
script:
- yarn install
cache:
<<: *global_cache
policy: pull-push
# Lint code with eslint
lint:
stage: test
script:
- yarn lint
build:
stage: test
script:
- yarn build
cache:
<<: *global_cache
policy: pull-push
audit production:
stage: test
script:
- yarn audit
only:
- master
- demo
audit:
stage: test
script:
- yarn audit
allow_failure: true
except:
- master
- demo
# Run jest tests
test:
stage: test
script:
- yarn test
coverage: /All\sfiles.*\s+(\d+(?:.\d+)?)/
artifacts:
reports:
cobertura: coverage/cobertura-coverage.xml
deploy:
stage: deploy
script:
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- npm publish --access public
only:
- tags
except:
- branches