-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
81 lines (71 loc) · 1.61 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
default:
image: node:18.20-alpine3.19
tags:
- k8s-agent-runner
.npm_cache:
cache:
- key:
files:
- package-lock.json
paths:
- .npm/
before_script:
# installing dependencies for node-canvas (https://github.com/Automattic/node-canvas)
- apk add --no-cache build-base g++ cairo-dev pango-dev jpeg-dev giflib-dev librsvg-dev
# installing project dependencies
- npm install
stages:
- check
- test
# - tag
# building the ES modules and node CLI (also ES module now, from commonJS)
- build
# - deploy
# Try a "clean" install (without forcing dependencies)
clean_install:
stage: check
script:
- npm install --dry-run
allow_failure: false
# Check if lock-file is compatible with packages.json
check_lockfile:
stage: check
script:
- npm install --prefer-offline --cache .npm --force
- git ls-files -m | grep -q package-lock.json &&
{ echo "WARNING - Lock file is outdated!" && exit 1; }
- exit 0
cache:
- !reference [.npm_cache, cache]
allow_failure: false
# Run npm audit
audit:
stage: check
script:
- npm audit
allow_failure: true
# Check code format with prettier
format:
stage: check
script:
- npm run format
allow_failure: false
test:
stage: test
script:
- npm test
allow_failure: false
build_module:
stage: build
script:
- npm ci --prefer-offline --cache .npm --force
- npm run build
cache:
- !reference [.npm_cache, cache]
build_nodecli:
stage: build
script:
- npm ci --prefer-offline --cache .npm --force
- npm run build:cli
cache:
- !reference [.npm_cache, cache]