diff --git a/.github/workflows/desktop-smoke.yml b/.github/workflows/desktop-smoke.yml new file mode 100644 index 0000000..767092c --- /dev/null +++ b/.github/workflows/desktop-smoke.yml @@ -0,0 +1,104 @@ +name: Desktop smoke (czdev + emulator + hello_cz) + +on: + push: + branches: [main, dev, ci/**] + paths: + - 'crates/czdev/**' + - 'emulator' + - 'examples/hello_cz/**' + - 'sdk/**' + - '.github/workflows/desktop-smoke.yml' + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + smoke: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04, macos-14] + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install deps (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + build-essential cmake pkg-config \ + libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype-dev \ + xvfb + + - name: Install deps (macOS) + if: runner.os == 'macOS' + run: | + brew install cmake pkg-config sdl2 sdl2_image sdl2_mixer freetype + + - uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: czdev doctor + run: cargo run -p czdev --release -- doctor + + - name: Build hello_cz (via czdev) + run: cargo run -p czdev --release -- build examples/hello_cz + + - name: Headless emulator smoke (Linux) + if: runner.os == 'Linux' + env: + SDL_VIDEODRIVER: dummy + SDL_AUDIODRIVER: dummy + run: | + set -e + cargo run -p czdev --release -- run examples/hello_cz & + EMU_PID=$! + sleep 5 + if ! kill -0 $EMU_PID 2>/dev/null; then + echo "::error::emulator exited before 5s"; exit 1 + fi + kill $EMU_PID || true + wait $EMU_PID 2>/dev/null || true + echo "emulator ran for 5s — OK" + + - name: Headless emulator smoke (macOS) + if: runner.os == 'macOS' + env: + SDL_VIDEODRIVER: dummy + SDL_AUDIODRIVER: dummy + run: | + set -e + cargo run -p czdev --release -- run examples/hello_cz & + EMU_PID=$! + sleep 5 + if ! kill -0 $EMU_PID 2>/dev/null; then + echo "::error::emulator exited before 5s"; exit 1 + fi + kill $EMU_PID || true + wait $EMU_PID 2>/dev/null || true + echo "emulator ran for 5s — OK" + + # Windows smoke is gated on the LVGL DLL rework (see DESKTOP_DEV.md §4 / T08). + # Keep an informational job so CI surfaces the status rather than failing silently. + windows-todo: + runs-on: windows-latest + steps: + - name: Windows desktop dev is pending + shell: bash + run: | + echo "Windows support for the czdev loop requires the emulator's" + echo "LVGL DLL rework (see docs/DESKTOP_DEV.md §4). Tracked as T08." + echo "This job is informational; it does not fail the workflow."