mirror of
https://github.com/imjasonh/nescript
synced 2026-07-08 08:55:38 +00:00
- CI: new "Build Examples" job compiles all .ne files and validates the output ROMs have correct iNES headers - Examples: add notes explaining that sprite names (Smiley, Ball) are parsed but not yet resolved — all draws use the built-in CHR tile 0. Custom sprite declarations come in M3. - Codegen: explicit `let _ = &draw.sprite_name` to document the intentional skip, with comment about M2/M3 scope https://claude.ai/code/session_01W6eQFStA66EuMKHUFo2rx3
79 lines
1.9 KiB
YAML
79 lines
1.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: "-D warnings"
|
|
|
|
jobs:
|
|
check:
|
|
name: Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: cargo check --all-targets
|
|
|
|
fmt:
|
|
name: Format
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
- run: cargo fmt --all -- --check
|
|
|
|
clippy:
|
|
name: Clippy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: cargo clippy --all-targets -- -D warnings
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: cargo test --all-targets
|
|
|
|
examples:
|
|
name: Build Examples
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: cargo build --release
|
|
- name: Compile all .ne examples
|
|
run: |
|
|
for f in examples/*.ne; do
|
|
echo "==> Compiling $f"
|
|
cargo run --release -- build "$f"
|
|
done
|
|
- name: Verify ROMs are valid iNES
|
|
run: |
|
|
for f in examples/*.nes; do
|
|
echo "==> Checking $f"
|
|
# iNES magic: first 4 bytes must be "NES\x1a"
|
|
header=$(od -A n -t x1 -N 4 "$f" | tr -d ' ')
|
|
if [ "$header" != "4e45531a" ]; then
|
|
echo "FAIL: $f is not a valid iNES ROM (header: $header)"
|
|
exit 1
|
|
fi
|
|
size=$(stat -c%s "$f")
|
|
echo " OK: $size bytes"
|
|
done
|