-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
69 lines (61 loc) · 1.19 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
---
include:
project: infra/gitlab
ref: master
file: templates/nodejs.ci.yml
default:
image: node:18
# to cache both npm modules and Cypress binary we use environment variables
# to point at the folders we can list as paths in "cache" job settings
variables:
npm_config_cache: "$CI_PROJECT_DIR/.npm"
CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress"
# cache using branch name
# https://gitlab.com/help/ci/caching/index.md
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .npm
- cache/Cypress
stages:
- prepare
- test
- publish
test:
image: cypress/base:18.16.0
stage: test
before_script:
- npm ci
script:
- npm run lint
- npm run check-types
- npm run build
- npm test
except:
- master
- tags
tags:
- test
prepare:
stage: prepare
image: node:18
before_script:
- npm cache clean -f
- npm ci --force --cache .npm --prefer-offline
- npm install -g [email protected] @semantic-release/[email protected]
script:
- npm run build
artifacts:
when: on_success
paths:
- dist
expire_in: 1 day
tags:
- test
- publish
publish:
stage: publish
extends: .publish_npm
only:
- master
- beta