-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
65 lines (50 loc) · 1.08 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
image: node:current-alpine
stages:
- npm
- test
- cleanup
cache: &cache_node_modules
paths:
- node_modules/
npm:
stage: npm
cache:
# inherit cache_node_modules settings
<<: *cache_node_modules
policy: push
tags:
- docker
script:
- npm cache clean --force
- npm install --force
test:
stage: test
cache:
# inherit cache_node_modules settings
<<: *cache_node_modules
policy: pull
tags:
- docker
script:
- npm run test
artifacts:
expire_in: 2 days
reports:
coverage_report:
coverage_format: cobertura
path: dist/coverage/cobertura-coverage.xml
cleanup:
stage: cleanup
cache:
# inherit cache_node_modules settings
<<: *cache_node_modules
policy: pull-push
script:
- echo "Cleaning up"
# clean caching directory
- rm -rf node_modules/
# make it available again so "nothing" can/will be cached
# if directory node_modules does not exist, cache will be
# considered as "uptodate" and remeains messy (no upload).
- mkdir node_modules
when: always