CI diagrams: install chromium + expose renderer stderr
ci / vet (push) Successful in 1m2s
ci / diagrams (push) Successful in 3m34s

The diagrams job ran without a browser (the earlier fix landed on a
deleted branch by mistake). Now installs Debian chromium, points
puppeteer at it, and prints mmdc stderr on failure.
Ticket: https://projects.knownelement.com/issues/832
This commit is contained in:
2026-09-07 10:08:24 -05:00
parent 659883f1d2
commit b3caef6888
+3 -2
View File
@@ -28,7 +28,8 @@ jobs:
- uses: actions/checkout@v4
- name: mermaid blocks must parse
run: |
apt-get update -qq >/dev/null && apt-get install -qq -y gawk >/dev/null
apt-get update -qq >/dev/null && apt-get install -qq -y gawk chromium >/dev/null
export PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# renderer + chromium inside minlag/mermaid-cli; mmdc parses without page render
QA=$(mktemp -d)
awk '/^```mermaid/{n++; f=QA"/d"n".mmd"; next} /^```/{f=""; next} f!=""{print > f}' QA="$QA" docs/*.md
@@ -36,6 +37,6 @@ jobs:
docker_target=skip
for f in "$QA"/d*.mmd; do
[ -f "$f" ] || continue
npx -y @mermaid-js/mermaid-cli@11 -p "$QA/pptr.json" -i "$f" -o /tmp/out.svg >/dev/null 2>&1 || { echo "::error::unrenderable diagram: $f"; exit 1; }
npx -y @mermaid-js/mermaid-cli@11 -p "$QA/pptr.json" -i "$f" -o /tmp/out.svg 2>/tmp/mmd-err.txt >/dev/null || { echo "::error::unrenderable diagram: $f"; tail -5 /tmp/mmd-err.txt; exit 1; }
echo "PARSE-OK: $f"
done