Repository navigation
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
107 lines (99 loc) · 3.98 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
107 lines (99 loc) · 3.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
stages:
- test
- guards
.rules_template:
rules:
- if: $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Both current LTS lines, which is exactly what the engines range
# `^22.13.0 || >=24.0.0` permits. The 22 floor is jsdom's, the strictest
# constraint in the tree. The range form rather than a `>=` is what keeps the
# odd-numbered lines out: 23 is above the floor by any arithmetic and has
# never had a supported day. Both jobs run the LATEST of their line, so
# neither exercises 22.13.0 itself.
#
# corepack activates the exact pnpm pinned in package.json's "packageManager"
# field, so CI and local installs use the same package manager version. The
# script then runs exactly the command list in the root README's Development
# section, in the same order, so CI can never report greener than a
# developer's local run.
#
# The apt line and the locale are the same two prerequisites, for the same
# reasons, that rig/lib/images.mjs puts into its toolchain image. Without them
# these jobs could not go green whatever the tree looked like, which is what
# they were until this commit: node:22 and node:24 are Debian bookworm with
# git, curl and python3 in them already, but with no ripgrep (four suites name
# it and go red), no xxd (the base package's inbox suite stops dead with `xxd:
# command not found`) and no locale at all (ten of the seventy
# delivery-classification cases fail in C, and the same break at runtime is a
# message never typed into a pane that was ready for it). Verified by running
# this exact sequence by hand in both images, there being no pipeline to push
# to.
#
# python3-yaml joined the list for the same class of reason. A stock python3
# is a python3 without PyYAML, and the base package's inbox CLI needs it to
# check that a card's metadata region parses as YAML before writing the
# block. Absent, the CLI refuses card sends by design rather than sending
# them unchecked, so its suite goes red on every card case and says exactly
# what is missing.
.test_template:
extends: .rules_template
stage: test
variables:
# An environment variable for the whole job, matching the rig's `ENV
# LANG=C.UTF-8` rather than a shell export, so it holds for anything the job
# runs and not only for whatever follows it in one script.
LANG: C.UTF-8
before_script:
- apt-get update && apt-get install -y --no-install-recommends ripgrep xxd jq python3-yaml tmux
- corepack enable
- corepack prepare --activate
script:
- pnpm install --frozen-lockfile
- pnpm typecheck
- pnpm test
- pnpm check:boundaries
test:node-22:
extends: .test_template
image: node:22
test:node-24:
extends: .test_template
image: node:24
# The self-test proves every denylist rule still fires (against
# runtime-assembled samples in a temp file, never committed fixtures) before
# the real scan certifies the tree clean.
leak-gate:
extends: .rules_template
stage: guards
image: node:22
script:
- node scripts/leak-gate.mjs --self-test
- node scripts/leak-gate.mjs
# PANE_IDLE_LIB_VERSION is a safety assertion that only holds while one number
# means one function surface; see scripts/lib-version-gate.mjs. The self-test
# proves the gate still catches a collision before the real check certifies the
# tree, same discipline as the leak gate above.
lib-version-gate:
extends: .rules_template
stage: guards
image: node:22
script:
- node scripts/lib-version-gate.mjs --self-test
- node scripts/lib-version-gate.mjs
gitleaks:
extends: .rules_template
stage: guards
image:
name: zricethezav/gitleaks:latest
entrypoint: [""]
script:
- gitleaks detect --source . --redact --verbose
# Kept as its own job so the red is unmistakably this gate. It FAILS on
# purpose until the LICENSE placeholder is replaced with the company's exact
# registered name; see scripts/licence-gate.mjs for the reasoning.
licence-gate:
extends: .rules_template
stage: guards
image: node:22
script:
- node scripts/licence-gate.mjs