@@ -14,34 +14,33 @@ jobs:
1414 runs-on : ubuntu-latest
1515 steps :
1616 - uses : actions/checkout@v4
17- - uses : pnpm/action-setup@v4
18- if : hashFiles('pnpm-lock.yaml') != '' && hashFiles('package-lock.json') == ''
19- with :
20- version : 11.7.0
2117 - uses : actions/setup-node@v4
2218 with :
2319 node-version : 22
24- - name : Install
25- run : |
26- if [ -f package-lock.json ]; then npm ci
27- elif [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile
28- else npm install --no-audit --no-fund
29- fi
30- - name : Build (if present)
31- run : npm run build --if-present || true
32- - name : Run dsh-plugin-doctor
20+ - name : Run dsh-plugin-doctor (static R/K on the committed tree)
3321 env :
3422 # Group names are YAML \u escapes so this file stays pure ASCII: a mojibake
3523 # round-trip used to make --only match no group, and the gate then passed
36- # silently with zero checks. The guard below fails loudly instead.
24+ # silently with zero checks. The guards below fail loudly instead.
3725 DOCTOR_ONLY : " \u9759\u6001\u00b7\u5305\u7ed3\u6784 ,\u9759\u6001\u00b7 cordis \u5951\u7ea6\u626b\u63cf "
3826 run : |
3927 if [ -z "$DOCTOR_ONLY" ]; then echo "DOCTOR_ONLY is empty"; exit 1; fi
4028 set +e
41- out="$(npx --yes @perrylink/dsh-plugin-doctor@0.1.4 --repo . --no-smoke --only "$DOCTOR_ONLY" 2>&1)"
42- code=$?
29+ out="$(npx --yes @perrylink/dsh-plugin-doctor@0.1.4 --repo . --no-smoke --only "$DOCTOR_ONLY" --json /tmp/doctor.json 2>&1)"
4330 set -e
4431 printf '%s\n' "$out"
4532 echo "$out" | grep -q 'R0 ' || { echo "::error::doctor ran no R checks"; exit 1; }
4633 echo "$out" | grep -q 'K1 ' || { echo "::error::doctor ran no K checks"; exit 1; }
47- exit $code
34+ if [ ! -f /tmp/doctor.json ]; then echo "::error::doctor produced no JSON report"; exit 1; fi
35+ # R2/R4 read the built entry (lib/). The family builds it in its own ci.yml
36+ # with the pinned harness aliases (HARNESS_COMMIT + gen-aliases); a build
37+ # here would fail without them and its prebuild would wipe the committed
38+ # lib/. They are reported but gated by ci.yml, not by this workflow.
39+ node -e '
40+ const r = JSON.parse(require("fs").readFileSync("/tmp/doctor.json", "utf8")).results
41+ const buildDep = r.filter((x) => /^R[24] /.test(x.name))
42+ const gated = r.filter((x) => !/^R[24] /.test(x.name))
43+ const bad = gated.filter((x) => x.status === "fail" || x.status === "error")
44+ console.log("gated " + gated.length + " checks; build-dependent (reported, not gated): " + (buildDep.map((x) => x.name.split(" ")[0] + "=" + x.status).join(" ") || "none"))
45+ if (bad.length) { console.error("::error::failing: " + bad.map((x) => x.name).join(" | ")); process.exit(1) }
46+ '
0 commit comments