Repository navigation
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
108 lines (101 loc) · 1.98 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
108 lines (101 loc) · 1.98 KB
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
include:
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate.gitlab-ci.yml'
stages:
- prepare
- qa
- deploy
default:
image: node:20.12.0
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- when: always
.if-code-change:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- changes:
- package-lock.json
- package.json
- .gitlab-ci.yml
- 'src/**/*'
- 'tests/**/*'
install:
stage: prepare
extends:
- .if-code-change
script:
- npm ci --cache .npm --prefer-offline
cache:
key:
files:
- package-lock.json
paths:
- .npm/
- node_modules/
policy: push
analysis:
stage: qa
extends:
- .if-code-change
cache:
key:
files:
- package-lock.json
paths:
- .npm/
- node_modules/
policy: pull
script:
- npm run qa:prettier:check
- npm run qa:lint
- npm run qa:duplication
test:
stage: qa
extends:
- .if-code-change
artifacts:
when: always
paths:
- junit-report.xml
reports:
junit: junit-report.xml
cache:
key:
files:
- package-lock.json
paths:
- .npm/
- node_modules/
policy: pull
script:
- npm run test:ci
coverage: '/Coverage: (\d{1,3}\.?\d{0,})%/'
publish_library:
stage: deploy
only:
- main
except:
- schedules
needs:
- test
dependencies:
- test
cache:
key:
files:
- package-lock.json
paths:
- .npm/
- node_modules/
policy: pull
before_script:
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${NPM_TOKEN}" > .npmrc
- echo "@${CI_PROJECT_NAMESPACE}:registry=${PACKAGE_REGISTRY_URL}" >> .npmrc
script:
- npm publish --registry "${PACKAGE_REGISTRY_URL}"
variables:
PACKAGE_REGISTRY_URL: '$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/npm/'
NPM_TOKEN: $CI_JOB_TOKEN