Files
Stefan ArentzandClaude Fable 5 fbad7d01de Phase 0: Rust workspace scaffolding + CI (#190)
* Phase 0: Rust workspace scaffolding + CI

Adds the parallel Rust workspace under rust/ per REWRITE.md:
- ewm-core (headless lib, zero dependencies) and ewm (binary,
  declares sdl2 now so CI installs SDL2 headers from day one;
  prints the same usage line as the C binary)
- rust-toolchain.toml pinning 1.91.1 with rustfmt + clippy
- GitHub Actions CI: C build job (ubuntu + libsdl2-dev) and Rust
  job (fmt --check, clippy -D warnings, test)
- Anchor the 'ewm' gitignore pattern to src/ so rust/ewm is tracked;
  ignore rust/target/
- README note pointing at REWRITE.md

The C tree in src/ is untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* CI: build the C tree on macOS

gcc on ubuntu fails -Werror with -Wimplicit-fallthrough in two.c;
src/ is frozen until Phase 9, so build C where it has always built
(macOS, as Travis did).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* CI: point clang at the Homebrew prefix via CPATH/LIBRARY_PATH

The committed Makefile does not search /opt/homebrew, so SDL2
headers are not found on the arm64 macOS runner. src/ is frozen,
so pass the paths through the environment instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 08:42:08 -04:00

49 lines
1.2 KiB
YAML

name: CI
on:
push:
branches: [master]
pull_request:
jobs:
# The C job builds on macOS (like the old Travis config): the tree uses
# -Werror and gcc on Linux flags an implicit fallthrough in two.c that
# clang does not. src/ is frozen until Phase 9, so the warning cannot be
# fixed there.
c:
name: C build
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install SDL2
run: brew install sdl2
# The committed Makefile does not search the Homebrew prefix, and src/
# cannot be changed; clang picks these paths up from the environment.
- name: Build
run: make -C src
env:
CPATH: /opt/homebrew/include
LIBRARY_PATH: /opt/homebrew/lib
rust:
name: Rust checks
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4
- name: Install SDL2
run: |
sudo apt-get update
sudo apt-get install -y libsdl2-dev
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
- name: Format
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test