mirror of
https://github.com/imjasonh/nescript
synced 2026-07-08 17:06:04 +00:00
docs: add docs/war.gif demo to README
Captures the first ~6 s of examples/war.ne via the same puppeteer + jsnes + gifenc pipeline that powers docs/platformer.gif: title menu thumbnail, 52-card deal animation, and a few rounds of CPU vs CPU play. Embedded in the top-level README right under the platformer demo. record_gif.mjs gains a 6th positional arg for the warmup override (defaulting to the existing WARMUP env / 30) so the war command can keep its title menu as the first frame while platformer keeps skipping past its own title. The CI emulator job and the pre-commit hook both rebuild the gif into a tmp path and fail-with-fix-command if the committed copy is stale; the war trigger covers war.ne, war.nes, any examples/war/*.ne include, plus the recorder and harness.
This commit is contained in:
parent
add0df6ff1
commit
318a2f8bef
6 changed files with 107 additions and 41 deletions
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
|
|
@ -161,6 +161,21 @@ jobs:
|
|||
echo "::error file=docs/platformer.gif::committed docs/platformer.gif is stale; rerun \`node tests/emulator/record_gif.mjs platformer 360 2 docs/platformer.gif\` and commit the new gif"
|
||||
exit 1
|
||||
fi
|
||||
- name: Verify docs/war.gif is up to date
|
||||
# Same contract as docs/platformer.gif: the README embeds
|
||||
# docs/war.gif as the second project demo, gifenc + jsnes are
|
||||
# deterministic, so any change to the compiler / runtime /
|
||||
# harness / war source that affects the first ~6 seconds of
|
||||
# the war.ne gameplay must be followed by regenerating the
|
||||
# gif. The 5th positional arg (`4`) is the warmup; war's
|
||||
# title menu is the gif thumbnail so we don't skip past it.
|
||||
working-directory: tests/emulator
|
||||
run: |
|
||||
node record_gif.mjs war 360 2 /tmp/war.gif 4
|
||||
if ! cmp -s ../../docs/war.gif /tmp/war.gif; then
|
||||
echo "::error file=docs/war.gif::committed docs/war.gif is stale; rerun \`node tests/emulator/record_gif.mjs war 360 2 docs/war.gif 4\` and commit the new gif"
|
||||
exit 1
|
||||
fi
|
||||
- name: Upload actual + diff PNGs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue