forked from e2e-test-quest/uuv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
186 lines (172 loc) · 3.92 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
variables:
NPM_PACKAGE_SCOPE: "uuv"
NPM_REPO: "registry.npmjs.org/"
stages:
- install
- lint
- build
- test
- publish
# Caches
.node_modules-cache: &node_modules-cache
key:
files:
- package-lock.json
paths:
- "node_modules"
- "packages/assistant/node_modules"
- "packages/docs/node_modules"
- "packages/runner-commons/node_modules"
- "packages/runner-cypress/node_modules"
- "packages/runner-playwright/node_modules"
policy: pull
install:
image: node:20.13.1-slim
stage: install
script:
- npm ci
cache:
- <<: *node_modules-cache
policy: pull-push
only:
- master
lint:
image: node:20.13.1-slim
stage: lint
script:
- npm run nx run-many -- --all --target=lint
allow_failure: true
cache:
- <<: *node_modules-cache
needs:
- install
only:
- master
build-runner-commons:
image: node:20.13.1-slim
stage: build
script:
- npm run nx build runner-commons
cache:
- <<: *node_modules-cache
needs:
- install
artifacts:
paths:
- "packages/runner-commons/dist"
only:
- master
build-runner-cypress:
image: node:20.13.1-slim
stage: build
script:
- npm run nx generate:step-definitions runner-cypress
- npm run nx generate:step-definitions-documentation runner-cypress
- npm run nx build runner-cypress
- cp ./LICENSE packages/runner-cypress/dist && cp ./CONTRIBUTING.md packages/runner-cypress/dist && cp ./DCO.txt packages/runner-cypress/dist
needs:
- install
- build-runner-commons
cache:
- <<: *node_modules-cache
artifacts:
paths:
- "packages/runner-cypress/dist"
- "packages/runner-cypress/src/cucumber/step_definitions/cypress/generated"
- "packages/docs/docs/04-wordings/01-generated-wording-description"
- "packages/docs/docs/05-tools"
only:
- master
build-assistant:
image: node:20.13.1-slim
stage: build
script:
- npm run nx react:build assistant
- npm run nx tsc:build assistant
- npm run nx conf:build assistant
- cp ./LICENSE packages/assistant/dist && cp ./CONTRIBUTING.md packages/assistant/dist && cp ./DCO.txt packages/assistant/dist
needs:
- install
cache:
- <<: *node_modules-cache
artifacts:
paths:
- "packages/assistant/dist"
- "packages/assistant/build"
only:
- master
build-docs:
image: node:20.13.1-slim
stage: build
script:
- npm run nx build docs
needs:
- install
- build-runner-cypress
cache:
- <<: *node_modules-cache
artifacts:
paths:
- "packages/docs/build"
only:
- master
test-cypress:
image: cypress/browsers:node18.12.0-chrome107
stage: test
script:
- npm ci
- cd packages/runner-cypress && npm run test:run
cache:
- <<: *node_modules-cache
needs:
- install
- build-runner-commons
- build-runner-cypress
only:
- master
.publish:
image: node:20.13.1-slim
stage: publish
cache:
- <<: *node_modules-cache
script:
- echo "//${NPM_REPO}:_authToken=$NPM_ACCESS_TOKEN" >> .npmrc
- cd ./packages/${PACKAGE_NAME}
- npm publish --scope ${NPM_PACKAGE_SCOPE} --access public
when: manual
only:
- master
publish-commons:
extends: .publish
variables:
PACKAGE_NAME: "runner-commons"
needs:
- build-runner-commons
publish-cypress:
extends: .publish
variables:
PACKAGE_NAME: "runner-cypress"
needs:
- build-runner-cypress
publish-assistant:
extends: .publish
variables:
PACKAGE_NAME: "assistant"
needs:
- build-assistant
pages:
image: ubuntu
stage: publish
script:
- mkdir public
- cp -r packages/docs/build/* ./public
needs:
- build-docs
artifacts:
paths:
- public
cache:
- <<: *node_modules-cache
when: manual
only:
- master