Repository navigation
193 lines (190 loc) · 9.91 KB
/
Copy pathci.yml
File metadata and controls
193 lines (190 loc) · 9.91 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
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
187
188
189
190
191
192
193
name: CI
on:
workflow_dispatch:
inputs:
base:
description: The commit or ref the ratchets' ceilings are compared with (default, the commit before this one on main; elsewhere, the merge base with main)
required: false
default: ''
pull_request:
push:
branches: [main]
jobs:
# Production-dependency advisory gate: a high-severity advisory in a
# shipped dependency fails the PR instead of surfacing during a release
# review. Dev-only advisories are deliberately out of scope (coverage
# tooling pins js-yaml 3.x, which has no backported fix). This job can
# go red on a PR that touched nothing: that is the gate working, and the
# fix is a dependency bump, not a revert.
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
- run: npm install -g npm@11.19.0
# The workspace has one lockfile, at the root, and this audit reads it. That is an audit of what each
# published workspace ships only if the lockfile describes it: `lint:audit-coverage`, in the check job
# (it needs the installed tree), fails the change otherwise.
- run: npm audit --omit=dev --audit-level=high
check:
runs-on: ubuntu-latest
strategy:
matrix:
node: [22, 24]
# What a ratchet's ceilings are compared with (scripts/lib/ratchetBase.mjs): a pull request's base is in
# GITHUB_BASE_REF; a push's is the commit the branch was at before it; a manual run may name one.
env:
RATCHET_BEFORE: ${{ github.event.before }}
RATCHET_BASE: ${{ inputs.base }}
steps:
# The whole history: a ratchet reads its baseline at the change's base, which must be here to be read.
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
fetch-depth: 0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node }}
cache: npm
# One exact npm version everywhere: lockfile shape drifts not only
# across npm majors (node 22 ships npm 10, node 24 npm 11) but within
# a major (11.6 omitted @emnapi optional-dep entries that 11.19
# requires). The lockfile is maintained with this exact version; bump
# it here, in the audit job above, and in release.yml, and regenerate
# the lockfile together.
- run: npm install -g npm@11.19.0
- run: npm ci
- run: npm run build
# Publish preflight: packs every workspace exactly as a release would,
# so publish-time rejections (invalid overrides, bin cleanup, missing
# files) fail this PR instead of the release run. No auth is needed.
# Between releases every workspace version already exists on the
# registry, so "cannot publish over" is the expected steady state and
# only OTHER npm errors fail the job.
- name: Publish preflight
run: |
set +e
out=$(npm publish --dry-run --workspaces 2>&1)
code=$?
echo "$out"
if [ $code -ne 0 ]; then
bad=$(grep '^npm error' <<<"$out" | grep -viE 'cannot publish over|A complete log of this run')
if [ -n "$bad" ]; then exit "$code"; fi
fi
- run: npm test
# The summary the argus coverage floor was judged from, kept whether the
# tests passed or not: the measure differs a little from machine to
# machine, and a fall is only found by reading it file by file.
- name: Keep the argus coverage summary
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: argus-coverage-node${{ matrix.node }}
path: apps/argus/coverage/coverage-summary.json
if-no-files-found: ignore
# Mock-free wire round trip: a real chell RemoteEngine attached to a
# real in-process CalypsoDaemon (attach, execute, completion, pipes,
# shell escapes, prompts, local edits). Needs no CUBE or credentials,
# so it gates every PR; the unit suites mock this boundary, this does
# not.
- run: npm run exemplars:build --workspace @fnndsc/chell
- run: |
node exemplars/ts/dist/06_wireRoundtrip.js
node exemplars/ts/dist/standalone/session_wire.js
working-directory: packages/chell
- name: Upload coverage to Codecov
if: matrix.node == 24
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
# Coverage is reported, never a gate: an outage at Codecov (its
# uploader failing a TLS handshake, 2026-10-05) must not block a
# release. fail_ci_if_error does not catch the action itself crashing.
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- run: npm run lint:tests
- run: npm run lint:seam
# Cast ratchet: each workspace's `as unknown as` count may only decrease, and its ceiling with it.
- run: npm run lint:casts
# Each workspace's jest coverage thresholds, kept in scripts/ratchet-baseline.json, may rise and never fall.
- run: npm run lint:coverage-thresholds
# The ratchets' own tests, and every test file reached by its workspace's jest (scripts/test-roots.mjs).
- run: npm run test:ratchets
# Principle checks (docs/principles.adoc). Two are hard checks; two are
# ratchets that cannot repair what exists but stop it growing.
- run: npm run lint:kernel
- run: npm run lint:fond
- run: npm run lint:trek
- run: npm run lint:core-deps
# The core boots over the null backend with no ChRIS package loaded.
- run: npm run test:core-boot --workspace @fnndsc/brasa
- run: npm run test:chili-words --workspace @fnndsc/brasa
# A worker's file is where its `new Worker` names it (checked on source),
# and the session's layout worker starts from the built package and
# lays a graph out (checked on the build).
- run: npm run lint:workers
- run: npm run lint:argv
- run: npm run lint:debris
# The root lockfile describes what every published workspace ships (its edges resolve, in range, none
# development-only), which is what makes the audit job's green an audit of them.
- run: npm run lint:audit-coverage
- run: npm run test:audit-coverage
- run: npm run test:debris
- run: npm run test:argv
- run: npm run test:layout-worker --workspace @fnndsc/brasa
# The nightly's accounting: a red stage or step is a non-zero exit.
- run: npm run test:nightly
# stratus: oci-* only inside its OCI driver, no ChRIS package; it boots
# over the fake cloud and walks the tenancy tree (docs/stratus.adoc).
- run: npm run lint:stratus-deps
- run: npm run test:boot --workspace @fnndsc/stratus
- run: npm run lint:commands
# One declaration per command: every group holds only declarations
# (lint:commands, above), and the commands parsing an expression
# language of their own may only fall in number.
- run: npm run lint:expressions
# One route from a typed path to the store: a call that reaches CUBE's
# files by path asks storePath_resolve, and no mount reads one itself.
- run: npm run lint:store-paths
- run: npm run lint:prompt
- run: npm run lint:wire
- run: npm run lint:listings
# A function's method is a verb, never a preposition (#1227).
- run: npm run lint:rpn
# A value a surface writes into a shell line goes through a quoting function, never quotes written by hand.
- run: npm run lint:lines
# chili is being retired: brasa's imports of it may only fall, and no other workspace may import it.
- run: npm run lint:chili
# An engine source that reaches its host (fs, child_process) is listed with its reason, and the gate calls are pinned.
- run: npm run lint:hostgate
# Every host write is a reviewed call site; a download's bytes only through fond's placed writer.
- run: npm run lint:host-writes
- run: npm run test:host-writes
# Every published package's main, types, bin and exports lead to files it would publish (run after the build).
- run: npm run lint:pack
# `make verify-npm` against a stand-in npm: any version not as published, or not read, fails it.
- run: npm run test:verify-npm
- run: npm run lint:changesets
- run: npm run lint:aegis
- run: npm run lint:orrery
# The style guide's rules over every workspace's sources, each rule in each workspace held to a ceiling
# that only falls (scripts/eslint-ratchet.mjs). No --if-present: a missing script fails the job.
- run: npm run test:lint
# The findings do not depend on the node that runs ESLint: counted once, on one leg of the matrix.
- if: matrix.node == 24
run: npm run lint
# The modularity checks: no function over 80 lines and no file over 800 (blank lines and comments not
# counted), each workspace's count held to a ceiling that only falls, every one over listed with its size
# (eslint.modularity.config.mjs, scripts/modularity-baseline.json); and duplicated code, by tokens, each
# workspace's duplicated tokens held the same way (scripts/clone-check.mjs, scripts/clone-baseline.json).
- run: npm run test:clones
- if: matrix.node == 24
run: npm run lint:modularity
# The shape checks: no function with a cognitive or cyclomatic complexity over 15 and no block nested
# more than 3 deep, each workspace's count held to a ceiling that only falls, every one over listed with
# its score (eslint.shape.config.mjs, scripts/shape-baseline.json).
- if: matrix.node == 24
run: npm run lint:shape
- if: matrix.node == 24
run: npm run lint:clones