niri
Clone
https://git.tahinli.com/Tahinli/niri.git
0 watching0 forksRustGPL-3.012.1 MiB9d8f4f8Ivan Molodetskikh1 month ago2997 commits
| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | pull_request: |
| 6 | workflow_dispatch: |
| 7 | schedule: |
| 8 | - cron: '0 0 1 * *' # Monthly |
| 9 | |
| 10 | env: |
| 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 | |
| 16 | jobs: |
| 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.1" |
| 266 | copyback: false |
| 267 | prepare: | |
| 268 | pkg update -f |
| 269 | pkg install -y ${{ env.DEPS_PKG }} |
| 270 | run: | |
| 271 | export CARGO_HOME="$PWD/cargo-home" |
| 272 | |
| 273 | cargo fetch |
| 274 | |
| 275 | ( |
| 276 | cd $CARGO_HOME/registry/src/index.crates.io-*/ |
| 277 | patch -p0 <<'PATCH' |
| 278 | --- pipewire-sys-0.10.1/build.rs |
| 279 | +++ pipewire-sys-0.10.1/build.rs |
| 280 | @@ -23,6 +23,8 @@ |
| 281 | .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) |
| 282 | .size_t_is_usize(true) |
| 283 | .allowlist_function("pw_.*") |
| 284 | + .allowlist_function("pipewire_init") |
| 285 | + .allowlist_function("pipewire_deinit") |
| 286 | .allowlist_type("pw_.*") |
| 287 | .allowlist_var("pw_.*") |
| 288 | .allowlist_var("PW_.*") |
| 289 | --- pipewire-sys-0.10.1/src/lib.rs |
| 290 | +++ pipewire-sys-0.10.1/src/lib.rs |
| 291 | @@ -13,0 +14,7 @@ |
| 292 | + |
| 293 | +// On FreeBSD, pw_init and pw_deinit are macros aliasing pipewire_init/pipewire_deinit, |
| 294 | +// so bindgen generates the underlying symbol names. Re-export them under the expected names. |
| 295 | +#[cfg(target_os = "freebsd")] |
| 296 | +pub use bindings::pipewire_init as pw_init; |
| 297 | +#[cfg(target_os = "freebsd")] |
| 298 | +pub use bindings::pipewire_deinit as pw_deinit; |
| 299 | --- libdisplay-info-sys-0.3.0/Cargo.toml |
| 300 | +++ libdisplay-info-sys-0.3.0/Cargo.toml |
| 301 | @@ -45 +45 @@ |
| 302 | -version = ">= 0.1.0, < 0.4.0" |
| 303 | +version = ">= 0.1.0" |
| 304 | PATCH |
| 305 | ) |
| 306 | |
| 307 | cargo build \ |
| 308 | --offline \ |
| 309 | --no-default-features --features dbus,xdp-gnome-screencast |
| 310 | |
| 311 | nix: |
| 312 | runs-on: ubuntu-24.04 |
| 313 | steps: |
| 314 | - name: Free Disk Space (Ubuntu) |
| 315 | uses: jlumbroso/free-disk-space@v1.3.1 |
| 316 | with: |
| 317 | dotnet: false |
| 318 | large-packages: false |
| 319 | |
| 320 | - uses: actions/checkout@v6 |
| 321 | with: |
| 322 | show-progress: false |
| 323 | |
| 324 | - name: Install Nix |
| 325 | uses: cachix/install-nix-action@v31 |
| 326 | continue-on-error: true |
| 327 | |
| 328 | - run: nix flake check |
| 329 | continue-on-error: true |
| 330 | |
| 331 | publish-wiki: |
| 332 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'niri-wm/niri' |
| 333 | needs: |
| 334 | - publish-docs |
| 335 | permissions: |
| 336 | contents: write |
| 337 | runs-on: ubuntu-24.04 |
| 338 | steps: |
| 339 | - uses: actions/checkout@v6 |
| 340 | with: |
| 341 | lfs: true |
| 342 | show-progress: false |
| 343 | |
| 344 | - uses: Andrew-Chen-Wang/github-wiki-action@b7e552d7cb0fa7f83e459012ffc6840fd87bcb83 |
| 345 | with: |
| 346 | path: docs/wiki/ |
| 347 | |
| 348 | build-docs: |
| 349 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'niri-wm/niri' |
| 350 | needs: |
| 351 | - test |
| 352 | runs-on: ubuntu-24.04 |
| 353 | steps: |
| 354 | - uses: actions/checkout@v6 |
| 355 | with: |
| 356 | lfs: true |
| 357 | show-progress: false |
| 358 | |
| 359 | - name: Install uv |
| 360 | uses: astral-sh/setup-uv@v10.3.0 |
| 361 | with: |
| 362 | enable-cache: true |
| 363 | |
| 364 | - name: Install the project |
| 365 | run: uv sync --locked --all-extras --dev |
| 366 | working-directory: docs/ |
| 367 | |
| 368 | - name: Generate niri documentation |
| 369 | run: uv run mkdocs build |
| 370 | working-directory: docs/ |
| 371 | |
| 372 | - uses: dtolnay/rust-toolchain@stable |
| 373 | |
| 374 | - name: Generate rustdoc documentation |
| 375 | run: cargo doc --no-deps -p niri-ipc |
| 376 | |
| 377 | - run: | |
| 378 | mkdir -p publish/niri_ipc |
| 379 | cp -r ./target/doc/* ./publish/ |
| 380 | cp -r ./docs/site/* ./publish/ |
| 381 | |
| 382 | - name: Upload pages artifact |
| 383 | uses: actions/upload-pages-artifact@v5 |
| 384 | with: |
| 385 | path: ./publish |
| 386 | |
| 387 | publish-docs: |
| 388 | runs-on: ubuntu-24.04 |
| 389 | needs: |
| 390 | - build-docs |
| 391 | permissions: |
| 392 | id-token: write |
| 393 | pages: write |
| 394 | steps: |
| 395 | - name: Deploy artifact to GitHub Pages |
| 396 | uses: actions/deploy-pages@v5 |