1
0
Fork 0
mirror of https://github.com/imjasonh/nescript synced 2026-07-09 01:16:12 +00:00

CI: add emulator smoke test job

Runs the jsnes + puppeteer harness on every push/PR so the same
execution-level bugs that the test suite previously couldn't catch
(missing JMP/JSR fixups, orphaned handler locals, uninitialized
struct fields, silently-swallowed intrinsic calls) will be caught in
CI going forward.

The job installs the handful of shared libs Chrome for Testing needs
on the ubuntu-latest runner, builds the compiler in release, compiles
every example, then drives each ROM through the harness. On failure
it uploads the captured screenshots and the JSON report as a build
artifact so regressions are easy to triage without re-running
locally.

Kept separate from the existing `Build Examples` job so compile-time
and execution-time issues report independently.

https://claude.ai/code/session_014Z5y3Q9krLcAxYpZQJhZ5V
This commit is contained in:
Claude 2026-04-12 18:49:36 +00:00
parent 81f3fd7de0
commit 24db4e6cda
No known key found for this signature in database

View file

@ -77,3 +77,58 @@ jobs:
size=$(stat -c%s "$f")
echo " OK: $size bytes"
done
emulator:
name: Emulator Smoke Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install Chrome runtime deps for puppeteer
# puppeteer ships its own Chrome for Testing binary via the
# package's postinstall hook, but the runner image is missing
# a handful of shared libs that Chrome needs to launch.
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libnss3 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libatspi2.0-0 \
libcups2t64 \
libdbus-1-3 \
libdrm2 \
libgbm1 \
libpango-1.0-0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxkbcommon0 \
libxrandr2 \
libasound2t64
- name: Build compiler
run: cargo build --release
- name: Compile all .ne examples
run: |
for f in examples/*.ne; do
echo "==> Compiling $f"
./target/release/nescript build "$f"
done
- name: Install emulator harness dependencies
working-directory: tests/emulator
run: npm ci
- name: Run each ROM in jsnes and verify it renders
working-directory: tests/emulator
run: node run_examples.mjs
- name: Upload emulator screenshots on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: emulator-screenshots
path: |
tests/emulator/screenshots/
tests/emulator/report.json