ci: add weston for run examples

This commit is contained in:
drendog 2025-12-11 23:45:02 +01:00
parent 2039684eb3
commit f560bd04c4
Signed by: dwenya
GPG key ID: 8DD77074645332D0

View file

@ -25,7 +25,8 @@ jobs:
libxkbcommon-dev \ libxkbcommon-dev \
libegl1-mesa-dev \ libegl1-mesa-dev \
libgles2-mesa-dev \ libgles2-mesa-dev \
libfontconfig1-dev libfontconfig1-dev \
weston
- name: Install Rust toolchain - name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
@ -73,12 +74,27 @@ jobs:
cargo build -p event-loop-examples cargo build -p event-loop-examples
cargo build -p runtime-surface-config cargo build -p runtime-surface-config
- name: Run examples with timeout - name: Run examples in headless Wayland compositor
run: | run: |
timeout 5 cargo run -p simple-bar || true export XDG_RUNTIME_DIR=/tmp
timeout 5 cargo run -p multi-surface || true export WAYLAND_DISPLAY=wayland-ci-test
timeout 5 cargo run -p declarative-config || true
timeout 5 cargo run -p event-loop-examples --bin timer || true weston --backend=headless-backend.so --no-config --socket=$WAYLAND_DISPLAY &
timeout 5 cargo run -p event-loop-examples --bin channel || true WESTON_PID=$!
timeout 5 cargo run -p event-loop-examples --bin custom-source || true
timeout 5 cargo run -p runtime-surface-config || true until test -S "/tmp/$WAYLAND_DISPLAY"; do
echo "Waiting for weston..."
sleep 0.5
done
echo "Weston started successfully"
timeout 5 cargo run -p simple-bar || echo "simple-bar timed out (expected)"
timeout 5 cargo run -p multi-surface || echo "multi-surface timed out (expected)"
timeout 5 cargo run -p declarative-config || echo "declarative-config timed out (expected)"
timeout 5 cargo run -p event-loop-examples --bin timer || echo "timer timed out (expected)"
timeout 5 cargo run -p event-loop-examples --bin channel || echo "channel timed out (expected)"
timeout 5 cargo run -p event-loop-examples --bin custom-source || echo "custom-source timed out (expected)"
timeout 5 cargo run -p runtime-surface-config || echo "runtime-surface-config timed out (expected)"
kill $WESTON_PID || true
wait $WESTON_PID 2>/dev/null || true