mirror of
https://github.com/m5stack/CardputerZero-AppBuilder.git
synced 2026-05-20 11:51:57 -07:00
ci: desktop-smoke — czdev doctor+build+run on mac and linux
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) <noreply@anthropic.com>
This commit is contained in:
committed by
eggfly
co-authored by
Claude Opus 4.7
parent
5a0c805a9b
commit
1e04368bc3
@@ -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."
|
||||
Reference in New Issue
Block a user