niri
Clone
https://git.tahinli.com/Tahinli/niri.git
0 watching0 forksRustGPL-3.012.1 MiB055a94dIvan Molodetskikh1 year ago2247 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 | RUN_SLOW_TESTS: 1 |
| 12 | 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 |
| 13 | 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 |
| 14 | 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 |
| 15 | |
| 16 | jobs: |
| 17 | build: |
| 18 | strategy: |
| 19 | fail-fast: false |
| 20 | |
| 21 | matrix: |
| 22 | configuration: |
| 23 | |
| 24 | include: |
| 25 | - configuration: release |
| 26 | release-flag: '--release' |
| 27 | |
| 28 | name: test - ${{ matrix.configuration }} |
| 29 | runs-on: ubuntu-24.04 |
| 30 | |
| 31 | steps: |
| 32 | - uses: actions/checkout@v4 |
| 33 | with: |
| 34 | show-progress: false |
| 35 | |
| 36 | - name: Install dependencies |
| 37 | run: | |
| 38 | sudo apt-get update -y |
| 39 | sudo apt-get install -y ${{ env.DEPS_APT }} |
| 40 | |
| 41 | - uses: dtolnay/rust-toolchain@stable |
| 42 | |
| 43 | - uses: Swatinem/rust-cache@v2 |
| 44 | with: |
| 45 | key: ${{ matrix.configuration }} |
| 46 | |
| 47 | - name: Check (no default features) |
| 48 | run: cargo check ${{ matrix.release-flag }} --no-default-features |
| 49 | |
| 50 | - name: Check (just dbus) |
| 51 | run: cargo check ${{ matrix.release-flag }} --no-default-features --features dbus |
| 52 | |
| 53 | - name: Check (just systemd) |
| 54 | run: cargo check ${{ matrix.release-flag }} --no-default-features --features systemd |
| 55 | |
| 56 | - name: Check (just dinit) |
| 57 | run: cargo check ${{ matrix.release-flag }} --no-default-features --features dinit |
| 58 | |
| 59 | - name: Check (just xdp-gnome-screencast) |
| 60 | run: cargo check ${{ matrix.release-flag }} --no-default-features --features xdp-gnome-screencast |
| 61 | |
| 62 | - name: Check |
| 63 | run: cargo check ${{ matrix.release-flag }} |
| 64 | |
| 65 | - name: Build (with profiling) |
| 66 | run: cargo build ${{ matrix.release-flag }} --features profile-with-tracy |
| 67 | |
| 68 | - name: Build tests |
| 69 | run: cargo test --no-run --all --exclude niri-visual-tests ${{ matrix.release-flag }} |
| 70 | |
| 71 | - name: Test |
| 72 | run: cargo test --all --exclude niri-visual-tests ${{ matrix.release-flag }} -- --nocapture |
| 73 | |
| 74 | build-musl: |
| 75 | strategy: |
| 76 | fail-fast: false |
| 77 | |
| 78 | name: alpine musl |
| 79 | runs-on: ubuntu-24.04 |
| 80 | container: alpine:3 |
| 81 | steps: |
| 82 | - uses: actions/checkout@v4 |
| 83 | with: |
| 84 | show-progress: false |
| 85 | |
| 86 | - name: Install Deps |
| 87 | run: apk add --no-cache ${{ env.DEPS_APK }} |
| 88 | |
| 89 | - uses: Swatinem/rust-cache@v2 |
| 90 | |
| 91 | - name: Build |
| 92 | run: cargo build --no-default-features --features dbus,xdp-gnome-screencast |
| 93 | |
| 94 | # Job that runs randomized tests for a longer period of time. |
| 95 | randomized-tests: |
| 96 | strategy: |
| 97 | fail-fast: false |
| 98 | |
| 99 | name: randomized tests |
| 100 | runs-on: ubuntu-24.04 |
| 101 | |
| 102 | env: |
| 103 | RUST_BACKTRACE: 1 |
| 104 | PROPTEST_CASES: 200000 |
| 105 | PROPTEST_MAX_LOCAL_REJECTS: 200000 |
| 106 | PROPTEST_MAX_GLOBAL_REJECTS: 200000 |
| 107 | PROPTEST_MAX_SHRINK_ITERS: 200000 |
| 108 | |
| 109 | steps: |
| 110 | - uses: actions/checkout@v4 |
| 111 | with: |
| 112 | show-progress: false |
| 113 | |
| 114 | - name: Install dependencies |
| 115 | run: | |
| 116 | sudo apt-get update -y |
| 117 | sudo apt-get install -y ${{ env.DEPS_APT }} |
| 118 | |
| 119 | - uses: dtolnay/rust-toolchain@stable |
| 120 | |
| 121 | - uses: Swatinem/rust-cache@v2 |
| 122 | |
| 123 | - name: Build tests |
| 124 | run: cargo test --no-run --all --exclude niri-visual-tests --release |
| 125 | |
| 126 | - name: Test |
| 127 | run: cargo test --all --exclude niri-visual-tests --release |
| 128 | |
| 129 | visual-tests: |
| 130 | strategy: |
| 131 | fail-fast: false |
| 132 | |
| 133 | name: visual tests |
| 134 | runs-on: ubuntu-24.04 |
| 135 | |
| 136 | steps: |
| 137 | - uses: actions/checkout@v4 |
| 138 | with: |
| 139 | show-progress: false |
| 140 | |
| 141 | - name: Install dependencies |
| 142 | run: | |
| 143 | sudo apt-get update -y |
| 144 | sudo apt-get install -y ${{ env.DEPS_APT }} libadwaita-1-dev |
| 145 | |
| 146 | - uses: dtolnay/rust-toolchain@stable |
| 147 | |
| 148 | - uses: Swatinem/rust-cache@v2 |
| 149 | |
| 150 | - name: Build |
| 151 | run: cargo build --package niri-visual-tests |
| 152 | |
| 153 | msrv: |
| 154 | strategy: |
| 155 | fail-fast: false |
| 156 | |
| 157 | name: msrv |
| 158 | runs-on: ubuntu-24.04 |
| 159 | |
| 160 | steps: |
| 161 | - uses: actions/checkout@v4 |
| 162 | with: |
| 163 | show-progress: false |
| 164 | |
| 165 | - name: Install dependencies |
| 166 | run: | |
| 167 | sudo apt-get update -y |
| 168 | sudo apt-get install -y ${{ env.DEPS_APT }} libadwaita-1-dev |
| 169 | |
| 170 | - uses: dtolnay/rust-toolchain@1.80.1 |
| 171 | |
| 172 | - uses: Swatinem/rust-cache@v2 |
| 173 | |
| 174 | - run: cargo check --all-targets |
| 175 | |
| 176 | clippy: |
| 177 | strategy: |
| 178 | fail-fast: false |
| 179 | |
| 180 | name: clippy |
| 181 | runs-on: ubuntu-24.04 |
| 182 | |
| 183 | steps: |
| 184 | - uses: actions/checkout@v4 |
| 185 | with: |
| 186 | show-progress: false |
| 187 | |
| 188 | - name: Install dependencies |
| 189 | run: | |
| 190 | sudo apt-get update -y |
| 191 | sudo apt-get install -y ${{ env.DEPS_APT }} libadwaita-1-dev |
| 192 | |
| 193 | - uses: dtolnay/rust-toolchain@stable |
| 194 | with: |
| 195 | components: clippy |
| 196 | |
| 197 | - uses: Swatinem/rust-cache@v2 |
| 198 | |
| 199 | - name: Run clippy |
| 200 | run: cargo clippy --all --all-targets |
| 201 | |
| 202 | rustfmt: |
| 203 | runs-on: ubuntu-24.04 |
| 204 | |
| 205 | steps: |
| 206 | - uses: actions/checkout@v4 |
| 207 | with: |
| 208 | show-progress: false |
| 209 | |
| 210 | - uses: dtolnay/rust-toolchain@nightly |
| 211 | with: |
| 212 | components: rustfmt |
| 213 | |
| 214 | - name: Run rustfmt |
| 215 | run: cargo fmt --all -- --check |
| 216 | |
| 217 | fedora: |
| 218 | runs-on: ubuntu-24.04 |
| 219 | container: fedora:41 |
| 220 | |
| 221 | steps: |
| 222 | - uses: actions/checkout@v4 |
| 223 | with: |
| 224 | show-progress: false |
| 225 | |
| 226 | - name: Install dependencies |
| 227 | run: | |
| 228 | sudo dnf update -y |
| 229 | sudo dnf install -y ${{ env.DEPS_DNF }} libadwaita-devel |
| 230 | |
| 231 | - uses: Swatinem/rust-cache@v2 |
| 232 | - run: cargo build --all |
| 233 | |
| 234 | nix: |
| 235 | runs-on: ubuntu-24.04 |
| 236 | steps: |
| 237 | - uses: actions/checkout@v4 |
| 238 | with: |
| 239 | show-progress: false |
| 240 | |
| 241 | - name: Check flake inputs |
| 242 | uses: DeterminateSystems/flake-checker-action@v4 |
| 243 | continue-on-error: true |
| 244 | |
| 245 | - name: Install Nix |
| 246 | uses: DeterminateSystems/nix-installer-action@v3 |
| 247 | continue-on-error: true |
| 248 | |
| 249 | - run: nix flake check |
| 250 | continue-on-error: true |
| 251 | |
| 252 | check-links: |
| 253 | runs-on: ubuntu-24.04 |
| 254 | steps: |
| 255 | - uses: actions/checkout@v4 |
| 256 | with: |
| 257 | show-progress: false |
| 258 | - uses: lycheeverse/lychee-action@v2.0.2 # later versions break fragment checks. don't bump until this is fixed: https://github.com/lycheeverse/lychee/issues/1574 |
| 259 | with: |
| 260 | args: --offline --include-fragments 'wiki/*.md' |
| 261 | |
| 262 | publish-wiki: |
| 263 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 264 | needs: |
| 265 | - build |
| 266 | - check-links |
| 267 | permissions: |
| 268 | contents: write |
| 269 | runs-on: ubuntu-24.04 |
| 270 | steps: |
| 271 | - uses: actions/checkout@v4 |
| 272 | with: |
| 273 | lfs: true |
| 274 | show-progress: false |
| 275 | - uses: Andrew-Chen-Wang/github-wiki-action@b7e552d7cb0fa7f83e459012ffc6840fd87bcb83 |
| 276 | |
| 277 | rustdoc: |
| 278 | needs: build |
| 279 | permissions: |
| 280 | contents: write |
| 281 | runs-on: ubuntu-24.04 |
| 282 | steps: |
| 283 | - uses: actions/checkout@v4 |
| 284 | with: |
| 285 | show-progress: false |
| 286 | |
| 287 | - uses: dtolnay/rust-toolchain@stable |
| 288 | |
| 289 | - name: Generate documentation |
| 290 | run: cargo doc --no-deps -p niri-ipc |
| 291 | |
| 292 | - run: cp ./resources/rustdoc-index.html ./target/doc/index.html |
| 293 | |
| 294 | - name: Deploy documentation |
| 295 | if: github.ref == 'refs/heads/main' |
| 296 | uses: peaceiris/actions-gh-pages@v4 |
| 297 | with: |
| 298 | github_token: ${{ secrets.GITHUB_TOKEN }} |
| 299 | publish_dir: ./target/doc |
| 300 | force_orphan: true |