forked from CopperlineHQ/Copperline
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (105 loc) · 4.67 KB
/
Copy pathlinux-present.yml
File metadata and controls
108 lines (105 loc) · 4.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Linux present
# Verifies Copperline's presentation path initializes and renders frames on
# Linux using software Vulkan (Mesa lavapipe) under a headless X server. Guards
# the "Vulkan required on Linux" policy in src/video/window.rs: wgpu's GL
# fallback drops to an unusable surfaceless EGL platform, so a Vulkan adapter
# (hardware or lavapipe) must be reachable for the window surface to come up.
# GitHub runners have no GPU, so this exercises the lavapipe path -- the same
# one a Vulkan-less host uses after installing a software ICD. The local
# equivalent for an Apple Silicon dev host is packaging/test-linux-vulkan/.
#
# A plain --screenshot-after run cannot test this: capture runs deliberately
# skip the window and event loop entirely (the windowless capture path in
# src/main.rs), so the smoke below starts a real windowed session with a
# control server attached (--control-gui keeps the windowed path) and drives
# a screenshot and a clean shutdown over the Copperline Control Protocol.
on:
push:
branches: [main]
paths:
- "src/video/**"
- "vendor/**"
- "Cargo.lock"
- "Cargo.toml"
- ".github/workflows/linux-present.yml"
pull_request:
paths:
- "src/video/**"
- "vendor/**"
- "Cargo.lock"
- "Cargo.toml"
- ".github/workflows/linux-present.yml"
concurrency:
group: linux-present-${{ github.ref }}
cancel-in-progress: true
jobs:
present-smoke:
name: Vulkan present smoke test
runs-on: ubuntu-latest
# The smoke waits on the emulator process; cap the job so a shutdown
# that never lands fails fast instead of idling for the default 6h.
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
# Build: ALSA (cpal) + udev (gilrs). Runtime: software Vulkan (Mesa
# lavapipe) + a virtual X server, plus the X11/xkb client libraries
# winit dlopens at startup (libxkbcommon-x11 in particular, which the
# runner image does not ship). CI runners have no GPU, so lavapipe is
# the only ICD present. Keep this list in sync with
# packaging/test-linux-vulkan/Dockerfile.
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libasound2-dev libudev-dev \
mesa-vulkan-drivers vulkan-tools \
xvfb xauth \
libxkbcommon0 libxkbcommon-x11-0 \
libx11-6 libx11-xcb1 libxcb1 \
libxcursor1 libxi6 libxrandr2 libxrender1 \
libwayland-client0
- name: Show Vulkan driver
run: vulkaninfo --summary | head -n 25
- name: Build
run: cargo build --release --locked --bin copperline --bin copperline-ctl
- name: Windowed present smoke (Vulkan surface + CCP screenshot)
# Boots the bundled AROS ROM in a real window on the virtual X
# server, which forces the wgpu instance/adapter/surface up on the
# lavapipe Vulkan ICD (the app aborts if no Vulkan adapter is
# reachable), then drives it over the control connection: a
# capture.screenshot proves the session is alive and rendering
# frames, and shutdown proves the event loop exits cleanly.
run: |
xvfb-run -a -s "-screen 0 1280x720x24" bash -euxo pipefail -c '
./target/release/copperline --noaudio \
--control-gui 127.0.0.1:0 --control-info /tmp/ccp.json &
emu=$!
# A failure anywhere below must not leave the emulator running
# until the job timeout; the trap is cleared on the clean path
# once the process has exited.
trap "kill $emu 2>/dev/null || true" EXIT
for _ in $(seq 1 60); do
[ -s /tmp/ccp.json ] && break
kill -0 "$emu"
sleep 1
done
[ -s /tmp/ccp.json ] || { echo "control endpoint never appeared"; exit 1; }
# Let the machine run a few wall-clock seconds of frames before
# sampling, so the screenshot comes from a live presenting loop.
sleep 5
./target/release/copperline-ctl --info /tmp/ccp.json \
capture.screenshot "{\"path\": \"/tmp/present.png\"}"
test -s /tmp/present.png
./target/release/copperline-ctl --info /tmp/ccp.json shutdown
wait "$emu"
trap - EXIT
'
echo "present path OK ($(stat -c %s /tmp/present.png) bytes)"
- name: Upload present screenshot
if: always()
uses: actions/upload-artifact@v7
with:
name: linux-present-screenshot
path: /tmp/present.png
if-no-files-found: ignore