forge
Explore
Log in

Don't you dare go Hollow

niri

Clone
★ 0

0 watching0 forksRustGPL-3.012.1 MiBb0eb8adIvan Molodetskikh3 months ago2857 commits

ci.yml363 lines, 9.5 KiBHistoryRawDownload
1name: CI
2
3on:
4 push:
5 pull_request:
6 workflow_dispatch:
7 schedule:
8 - cron: '0 0 1 * *' # Monthly
9
10env:
11 DEPS_APT: curl gcc clang libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libpipewire-0.3-dev libpango1.0-dev libdisplay-info-dev
12 DEPS_DNF: cargo gcc clang libudev-devel libgbm-devel libxkbcommon-devel wayland-devel libinput-devel dbus-devel systemd-devel libseat-devel pipewire-devel pango-devel cairo-gobject-devel libdisplay-info-devel
13 DEPS_APK: cargo clang-libclang eudev-dev glib-dev libdisplay-info-dev libinput-dev libseat-dev libxkbcommon-dev mesa-dev pango-dev pipewire-dev tar
14 DEPS_PKG: git curl rust llvm pkgconf pixman libudev-devd libdisplay-info seatd libinput libxkbcommon pipewire mesa-libs cairo devel/glib20 gettext-runtime harfbuzz pango
15
16jobs:
17 test:
18 strategy:
19 fail-fast: false
20
21 name: test
22 runs-on: ubuntu-24.04
23
24 steps:
25 - uses: actions/checkout@v6
26 with:
27 show-progress: false
28
29 - name: Install dependencies
30 run: |
31 sudo apt-get update -y
32 sudo apt-get install -y ${{ env.DEPS_APT }}
33
34 - uses: dtolnay/rust-toolchain@stable
35
36 - uses: Swatinem/rust-cache@v2
37
38 - name: Build tests
39 run: cargo test --no-run --all --exclude niri-visual-tests
40
41 - name: Test
42 run: cargo test --all --exclude niri-visual-tests -- --nocapture
43
44 build:
45 strategy:
46 fail-fast: false
47
48 name: check feature combinations
49 runs-on: ubuntu-24.04
50
51 steps:
52 - uses: actions/checkout@v6
53 with:
54 show-progress: false
55
56 - name: Install dependencies
57 run: |
58 sudo apt-get update -y
59 sudo apt-get install -y ${{ env.DEPS_APT }}
60
61 - uses: dtolnay/rust-toolchain@stable
62
63 - uses: Swatinem/rust-cache@v2
64
65 - name: Check (no default features)
66 run: cargo check --no-default-features
67
68 - name: Check (just dbus)
69 run: cargo check --no-default-features --features dbus
70
71 - name: Check (just systemd)
72 run: cargo check --no-default-features --features systemd
73
74 - name: Check (just dinit)
75 run: cargo check --no-default-features --features dinit
76
77 - name: Check (just xdp-gnome-screencast)
78 run: cargo check --no-default-features --features xdp-gnome-screencast
79
80 - name: Check
81 run: cargo check
82
83 - name: Build (with profiling)
84 run: cargo build --features profile-with-tracy
85
86 build-musl:
87 strategy:
88 fail-fast: false
89
90 name: alpine musl
91 runs-on: ubuntu-24.04
92 container: alpine:3
93 steps:
94 - uses: actions/checkout@v6
95 with:
96 show-progress: false
97
98 - name: Install Deps
99 run: apk add --no-cache ${{ env.DEPS_APK }}
100
101 - uses: Swatinem/rust-cache@v2
102
103 - name: Build
104 run: cargo build --no-default-features --features dbus,xdp-gnome-screencast
105
106 # Job that runs randomized tests for a longer period of time.
107 # Also runs normal slow tests.
108 randomized-tests:
109 strategy:
110 fail-fast: false
111
112 name: randomized and slow tests
113 runs-on: ubuntu-24.04
114
115 env:
116 RUST_BACKTRACE: 1
117 RUN_SLOW_TESTS: 1
118 PROPTEST_CASES: 200000
119 PROPTEST_MAX_LOCAL_REJECTS: 200000
120 PROPTEST_MAX_GLOBAL_REJECTS: 200000
121 PROPTEST_MAX_SHRINK_ITERS: 200000
122
123 steps:
124 - uses: actions/checkout@v6
125 with:
126 show-progress: false
127
128 - name: Install dependencies
129 run: |
130 sudo apt-get update -y
131 sudo apt-get install -y ${{ env.DEPS_APT }}
132
133 - uses: dtolnay/rust-toolchain@stable
134
135 - uses: Swatinem/rust-cache@v2
136
137 - name: Build tests
138 run: cargo test --no-run --all --exclude niri-visual-tests --release
139
140 - name: Test
141 run: cargo test --all --exclude niri-visual-tests --release
142
143 visual-tests:
144 strategy:
145 fail-fast: false
146
147 name: visual tests
148 runs-on: ubuntu-24.04
149
150 steps:
151 - uses: actions/checkout@v6
152 with:
153 show-progress: false
154
155 - name: Install dependencies
156 run: |
157 sudo apt-get update -y
158 sudo apt-get install -y ${{ env.DEPS_APT }} libadwaita-1-dev
159
160 - uses: dtolnay/rust-toolchain@stable
161
162 - uses: Swatinem/rust-cache@v2
163
164 - name: Build
165 run: cargo build --package niri-visual-tests
166
167 msrv:
168 strategy:
169 fail-fast: false
170
171 name: msrv
172 runs-on: ubuntu-24.04
173
174 steps:
175 - uses: actions/checkout@v6
176 with:
177 show-progress: false
178
179 - name: Install dependencies
180 run: |
181 sudo apt-get update -y
182 sudo apt-get install -y ${{ env.DEPS_APT }} libadwaita-1-dev
183
184 - uses: dtolnay/rust-toolchain@1.87.0
185
186 - uses: Swatinem/rust-cache@v2
187
188 - run: cargo check --all-targets
189
190 clippy:
191 strategy:
192 fail-fast: false
193
194 name: clippy
195 runs-on: ubuntu-24.04
196
197 steps:
198 - uses: actions/checkout@v6
199 with:
200 show-progress: false
201
202 - name: Install dependencies
203 run: |
204 sudo apt-get update -y
205 sudo apt-get install -y ${{ env.DEPS_APT }} libadwaita-1-dev
206
207 - uses: dtolnay/rust-toolchain@stable
208 with:
209 components: clippy
210
211 - uses: Swatinem/rust-cache@v2
212
213 - name: Run clippy
214 run: cargo clippy --all --all-targets
215
216 rustfmt:
217 runs-on: ubuntu-24.04
218
219 steps:
220 - uses: actions/checkout@v6
221 with:
222 show-progress: false
223
224 - uses: dtolnay/rust-toolchain@nightly
225 with:
226 components: rustfmt
227
228 - name: Run rustfmt
229 run: cargo fmt --all -- --check
230
231 fedora:
232 runs-on: ubuntu-24.04
233 container: fedora:42
234
235 steps:
236 - uses: actions/checkout@v6
237 with:
238 show-progress: false
239
240 - name: Install dependencies
241 run: |
242 sudo dnf update -y
243 sudo dnf install -y ${{ env.DEPS_DNF }} libadwaita-devel
244
245 - uses: Swatinem/rust-cache@v2
246 - run: cargo build --all
247
248 freebsd:
249 runs-on: ubuntu-24.04
250 env:
251 CARGO_HOME: /home/runner/work/niri/niri/cargo-home
252
253 steps:
254 - uses: actions/checkout@v6
255 with:
256 show-progress: false
257
258 # Remove man-db triggers to speed up Ubuntu upgrade by a minute or two during vmactions/freebsd-vm action run.
259 - run: |
260 sudo rm /var/lib/dpkg/info/man-db.*
261
262 - name: Build
263 uses: vmactions/freebsd-vm@v1
264 with:
265 release: "15.0"
266 copyback: false
267 prepare: |
268 pkg update -f
269 pkg install -y ${{ env.DEPS_PKG }}
270 run: |
271 wcurl 'https://raw.githubusercontent.com/freebsd/freebsd-ports/268f8513e0b5f26e87b296f861059048196cbf8f/audio/songrec/files/patch-cargo-crates_pipewire-sys-0.10.0_build.rs'
272 wcurl 'https://raw.githubusercontent.com/freebsd/freebsd-ports/268f8513e0b5f26e87b296f861059048196cbf8f/audio/songrec/files/patch-cargo-crates_pipewire-sys-0.10.0_src_lib.rs'
273 wcurl 'https://raw.githubusercontent.com/freebsd/freebsd-ports/bc722672141332346c78fd4eed7cab079b4165cc/x11-wm/niri/files/patch-libdisplay-info-0.3'
274
275 export CARGO_HOME="$PWD/cargo-home"
276
277 cargo fetch
278
279 ( cd $CARGO_HOME/registry/src/index.crates.io-*/; patch -p1 < $CARGO_HOME/../patch-cargo-crates_pipewire-sys-0.10.0_build.rs; patch -p1 < $CARGO_HOME/../patch-cargo-crates_pipewire-sys-0.10.0_src_lib.rs; patch -p1 < $CARGO_HOME/../patch-libdisplay-info-0.3; )
280
281 cargo build \
282 --offline \
283 --no-default-features --features dbus,xdp-gnome-screencast
284
285 nix:
286 runs-on: ubuntu-24.04
287 steps:
288 - name: Free Disk Space (Ubuntu)
289 uses: jlumbroso/free-disk-space@v1.3.1
290 with:
291 dotnet: false
292 large-packages: false
293
294 - uses: actions/checkout@v6
295 with:
296 show-progress: false
297
298 - name: Install Nix
299 uses: cachix/install-nix-action@v31
300 continue-on-error: true
301
302 - run: nix flake check
303 continue-on-error: true
304
305 publish-wiki:
306 if: github.event_name == 'push' && github.ref == 'refs/heads/main'
307 needs:
308 - publish-docs
309 permissions:
310 contents: write
311 runs-on: ubuntu-24.04
312 steps:
313 - uses: actions/checkout@v6
314 with:
315 lfs: true
316 show-progress: false
317
318 - uses: Andrew-Chen-Wang/github-wiki-action@b7e552d7cb0fa7f83e459012ffc6840fd87bcb83
319 with:
320 path: docs/wiki/
321
322 publish-docs:
323 if: github.event_name == 'push' && github.ref == 'refs/heads/main'
324 needs:
325 - test
326 permissions:
327 contents: write
328 runs-on: ubuntu-24.04
329 steps:
330 - uses: actions/checkout@v6
331 with:
332 lfs: true
333 show-progress: false
334
335 - name: Install uv
336 uses: astral-sh/setup-uv@v6
337 with:
338 enable-cache: true
339
340 - name: Install the project
341 run: uv sync --locked --all-extras --dev
342 working-directory: docs/
343
344 - name: Generate niri documentation
345 run: uv run mkdocs build
346 working-directory: docs/
347
348 - uses: dtolnay/rust-toolchain@stable
349
350 - name: Generate rustdoc documentation
351 run: cargo doc --no-deps -p niri-ipc
352
353 - run: mkdir -p publish/niri_ipc
354 - run: cp -r ./target/doc/* ./publish/
355 - run: cp -r ./docs/site/* ./publish/
356
357 - name: Deploy documentation
358 if: github.ref == 'refs/heads/main'
359 uses: peaceiris/actions-gh-pages@v4
360 with:
361 github_token: ${{ secrets.GITHUB_TOKEN }}
362 publish_dir: ./publish
363 force_orphan: true