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