-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
69 lines (58 loc) · 2.11 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
69 lines (58 loc) · 2.11 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
# ─────────────────────────────────────────────────────────────
# node-i3x — GitLab CI/CD pipeline
# ─────────────────────────────────────────────────────────────
stages:
- test
variables:
NODE_ENV: development
npm_config_cache: "$CI_PROJECT_DIR/.npm"
default:
image: node:22-slim
before_script:
# Configure the private @sterfive registry.
# Set NPM_STERFIVE_TOKEN in GitLab CI/CD variables (masked).
- |
echo "@sterfive:registry=https://npm-registry.sterfive.fr" > .npmrc
if [ -n "$NPM_STERFIVE_TOKEN" ]; then
echo "//npm-registry.sterfive.fr/:_authToken=${NPM_STERFIVE_TOKEN}" >> .npmrc
fi
cache:
key:
files:
- package-lock.json
paths:
- .npm/
ci:
stage: test
script:
- echo "── Installing dependencies ──"
- npm ci
- echo "── Building all packages ──"
- npm run build
- echo "── Running Lint and Type Check (Concurrent) ──"
- |
npx biome check . &
PID_LINT=$!
npm run typecheck &
PID_TYPECHECK=$!
wait $PID_LINT
EXIT_LINT=$?
wait $PID_TYPECHECK
EXIT_TYPECHECK=$?
if [ $EXIT_LINT -ne 0 ] || [ $EXIT_TYPECHECK -ne 0 ]; then
echo "Lint or Typecheck failed"
exit 1
fi
- echo "── Running tests with coverage ──"
- npm run coverage
- echo "── Removing @sterfive/opcua-optimized-client ──"
- npm ls @sterfive/opcua-optimized-client 2>/dev/null && npm rm @sterfive/opcua-optimized-client || echo "Not installed — good"
- "! node -e \"require.resolve('@sterfive/opcua-optimized-client')\" 2>/dev/null || (echo 'FAIL: package still resolvable' && exit 1)"
- echo "── Running tests without optimized client ──"
- npm test
coverage: '/All files\s+\|\s+[\d.]+/'
artifacts:
when: always
paths:
- coverage/
expire_in: 7 days