-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (90 loc) · 3.34 KB
/
Copy pathci.yml
File metadata and controls
108 lines (90 loc) · 3.34 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: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
jobs:
check:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
# iced's winit/wgpu backend needs X11/Wayland and udev headers on Linux.
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libxkbcommon-dev libwayland-dev libxcb1-dev \
libx11-dev libxrandr-dev libxi-dev libudev-dev \
mesa-vulkan-drivers
- name: Format
if: runner.os == 'Linux'
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --workspace --all-targets
- name: Test
run: cargo test --workspace
- name: Build release
run: cargo build --workspace --release
# Does the window actually open on Linux? Nothing else here answers that:
# `cargo build` proves the code compiles, and the unit tests never touch wgpu.
# The client renders its own screenshots through iced's renderer, so this needs
# a GPU adapter but no screen-capture permissions.
#
# `continue-on-error` because a headless runner getting a working lavapipe
# adapter is not something this repository can promise — the honest position is
# to run it and read the log, rather than to assert a green tick it may not be
# able to earn. Promote it to a required check once it has been seen passing.
smoke:
name: linux boot smoke
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install runtime dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libxkbcommon-dev libwayland-dev libxcb1-dev \
libx11-dev libxrandr-dev libxi-dev libudev-dev \
mesa-vulkan-drivers libgl1-mesa-dri xvfb
# Capture mode is the only way to run this app unattended: it renders,
# saves a PNG and exits. Launching it without `LORE_CAPTURE` would open a
# window and sit there until the job timed out.
- name: Capture the workspace screen
timeout-minutes: 5
env:
LORE_CAPTURE: /tmp/workspace.png
LORE_CAPTURE_SCREEN: workspace
# lavapipe: software Vulkan, since the runner has no GPU.
LIBGL_ALWAYS_SOFTWARE: "1"
WGPU_BACKEND: vulkan
RUST_LOG: lore_app=debug
run: |
xvfb-run -a --server-args="-screen 0 1600x1000x24" \
cargo run -p lore-app
# A blank or truncated PNG must not read as success. The real screens
# are 130 KB and up; anything far below that did not draw the UI.
size=$(stat -c%s /tmp/workspace.png)
echo "workspace.png is $size bytes"
test "$size" -gt 50000
- uses: actions/upload-artifact@v4
if: always()
with:
name: linux-screenshot
path: /tmp/workspace.png
if-no-files-found: warn