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
name: CI
on:
push:
branches:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: fmt + clippy + test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install system deps
# wdotool links against libxkbcommon and libwayland at build time.
run: |
sudo apt-get update
sudo apt-get install -y libxkbcommon-dev libwayland-dev
- name: Install Rust toolchain
# rustup is already preinstalled on ubuntu-22.04; pin components.
run: rustup show && rustup component add rustfmt clippy
- name: Cache cargo registry + target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: cargo fmt --check
run: cargo fmt --all -- --check
- name: cargo clippy
# -D warnings turns clippy findings into errors so regressions show up
# as a red CI. Remove individual lints with #[allow] at the use site,
# not by weakening this flag.
run: cargo clippy --all-targets -- -D warnings
- name: cargo test
run: cargo test --all-targets --locked
# TODO(integration): boot wdotool under a headless wlroots compositor.
# First attempt used `cage` from Ubuntu 22.04 (0.1.4), which exited code
# 1 with no output under WLR_BACKENDS=headless on a GitHub runner — not
# enough signal to diagnose cheaply. Alternatives to explore later:
# - labwc with -C /dev/null and WLR_BACKENDS=headless
# - sway --headless with a minimal config
# - a purpose-built test harness that binds the wlr protocols as
# a server (mocks the compositor side, asserts our requests)