fix(ci): run public pages via bash script with per-file logging

Move the Build & export loop into scripts/run-public-pages.sh (explicit
bash, skip files without # main) so CI failures show which demo broke.
Also quote remaining time/json italic string args.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-28 12:27:57 +08:00
1 parent 0fddc3bf05
commit 7317a653c7
5 files changed
+24 -14

No files matched your search

+3 -9
View File
@@ -11,6 +11,7 @@ on:
- "Cargo.lock"
- ".github/workflows/pages.yml"
- "scripts/build-public.*"
- "scripts/run-public-pages.sh"
workflow_dispatch:
permissions:
@@ -26,15 +27,8 @@ jobs:
uses: dtolnay/rust-toolchain@stable
- name: Build & export site
run: |
cargo build --release
# Skip import helpers and any demo without `# main` (locale-safe; no UTF-8 names in find).
set -e
while IFS= read -r -d '' f; do
grep -q '^# main' "$f" || continue
./target/release/marqdo run "$f"
done < <(find public -name '*.mq.md' -print0)
./target/release/marqdo view output public -o public
shell: bash
run: bash scripts/run-public-pages.sh
- name: Verify site shape
run: |
+1 -1
View File
@@ -8,7 +8,7 @@ import json:lib/json.mq.md
Import lib/json.mq.md from both English and Chinese docs (no translated twin). Functions: parse(text), stringify(value), get(value, key), keys(value), quote(text) — JSON string literal with quotes (for building request bodies). Objects become the map runtime type.
*`obj` = > json.parse text={} *
*`obj` = > json.parse text="{}"*
*`ty` = > type `obj` *
+2 -2
View File
@@ -8,11 +8,11 @@ import time:lib/time.mq.md
Import lib/time.mq.md. Functions: now_unix, now_ms, format(unix, pattern), parse(text, pattern), sleep_ms(ms). Patterns use strftime.
*`s` = > time.format unix=0 pattern=%Y-%m-%d *
*`s` = > time.format unix=0 pattern="%Y-%m-%d"*
> print text=`s`
*`u` = > time.parse text=1970-01-01 00:00:00 pattern=%Y-%m-%d %H:%M:%S *
*`u` = > time.parse text="1970-01-01 00:00:00" pattern="%Y-%m-%d %H:%M:%S"*
> print text=`u`
+2 -2
View File
@@ -8,11 +8,11 @@ description: Unix 时间、格式化、解析、睡眠
导入 lib/时间.mq.md。函数:此刻秒、此刻毫秒、格式化(秒, 格式)、解析时间(内容, 格式)、睡眠毫秒(毫秒)。格式为 strftime。
*`s` = > 时间.格式化 秒=0 格式=%Y-%m-%d *
*`s` = > 时间.格式化 秒=0 格式="%Y-%m-%d"*
> 打印 内容=`s`
*`u` = > 时间.解析时间 内容=1970-01-01 00:00:00 格式=%Y-%m-%d %H:%M:%S *
*`u` = > 时间.解析时间 内容="1970-01-01 00:00:00" 格式="%Y-%m-%d %H:%M:%S"*
> 打印 内容=`u`
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Run every public/*.mq.md that defines `# main`, then export the site.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
cargo build --release
BIN=./target/release/marqdo
while IFS= read -r -d '' f; do
if grep -q '^# main' "$f"; then
echo "+ marqdo run $f"
"$BIN" run "$f"
else
echo "- skip (no # main): $f"
fi
done < <(find public -name '*.mq.md' -print0)
"$BIN" view output public -o public