Skip to content

Commit 76b166a

Browse files
authored
fix(ci): capture workflow — headless default, xvfb 24-bit depth, unmask exit codes (#62)
Verification runs on main: headless run succeeded end-to-end (both scenes + promo + demo.webm — artifact visually verified), the xvfb run failed because xvfb-run's default screen is 8-bit and Chromium's Page.captureScreenshot requires 24-bit. Fixes: headless becomes the default (now the verified-best path on Linux CI), the xvfb fallback gets --server-args='-screen 0 1920x1080x24', and the shotkit pipe is replaced with a redirect (default GH shell lacks pipefail, so the pipe masked shotkit's exit code and the summary step crashed instead).
1 parent faef073 commit 76b166a

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/capture.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ on:
1818
type: boolean
1919
default: true
2020
headless:
21-
description: 'Run headless instead of under xvfb (experimental)'
21+
description: 'Run headless (verified on Linux CI incl. video); false = headed under xvfb'
2222
type: boolean
23-
default: false
23+
default: true
2424

2525
permissions:
2626
contents: read
@@ -70,13 +70,19 @@ jobs:
7070
ARGS=()
7171
if [ -n "$SCENE" ]; then ARGS+=(--scene "$SCENE"); fi
7272
if [ "$VIDEO" != "true" ]; then ARGS+=(--no-video); fi
73+
# No pipe around shotkit — the default GH shell lacks pipefail, and a
74+
# pipe would mask its exit code. Progress logs stream live on stderr.
7375
if [ "$HEADLESS" = "true" ]; then
74-
HEADED=0 npx shotkit --json "${ARGS[@]}" | tee shotkit-result.json
76+
HEADED=0 npx shotkit --json "${ARGS[@]}" > shotkit-result.json
7577
else
76-
xvfb-run -a npx shotkit --json "${ARGS[@]}" | tee shotkit-result.json
78+
# 24-bit depth is required — xvfb-run's default 8-bit screen makes
79+
# Chromium's Page.captureScreenshot fail ("Unable to capture screenshot").
80+
xvfb-run -a --server-args="-screen 0 1920x1080x24" \
81+
npx shotkit --json "${ARGS[@]}" > shotkit-result.json
7782
fi
83+
cat shotkit-result.json
7884
{ echo "### shotkit assets"
79-
node -e "const r=require('./shotkit-result.json'); console.log(r.produced.map(p=>'- \`'+p.split('/').pop()+'\`').join('\n'))"
85+
node -e "const r=require('./shotkit-result.json'); console.log((r.produced||[]).map(p=>'- \`'+p.split('/').pop()+'\`').join('\n'))"
8086
} >> "$GITHUB_STEP_SUMMARY"
8187
8288
- name: Upload assets

0 commit comments

Comments
 (0)