From 1e04368bc37e5e106d7dbe3085e6af11635c294e Mon Sep 17 00:00:00 2001 From: LiHaohua Date: Fri, 1 May 2026 17:29:31 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20desktop-smoke=20=E2=80=94=20czdev=20docto?= =?UTF-8?q?r+build+run=20on=20mac=20and=20linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Matrix job installs SDL2/freetype/cmake, runs czdev doctor, builds hello_cz, then headless-launches the emulator with SDL_VIDEODRIVER=dummy and asserts it survives for 5s. Windows has a separate informational job that surfaces the pending LVGL DLL rework (T08 in DESKTOP_DEV.md §4) rather than failing silently. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/desktop-smoke.yml | 104 ++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .github/workflows/desktop-smoke.yml 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."