ci: Make sure we lint and test all features

This commit is contained in:
Victoria Brekenfeld 2026-03-20 13:41:56 +01:00 committed by Victoria Brekenfeld
parent 5216eb50ba
commit c6a3a046e4

View file

@ -1,103 +1,104 @@
name: Continuous Integration name: Continuous Integration
on: on:
push: push:
branches: [master] branches: [master]
pull_request: pull_request:
branches: [master] branches: [master]
jobs: jobs:
format: format:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Rust toolchain - name: Rust toolchain
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:
components: rustfmt components: rustfmt
- name: Cargo cache - name: Cargo cache
uses: actions/cache@v5 uses: actions/cache@v5
with: with:
path: | path: |
~/.cargo/registry ~/.cargo/registry
~/.cargo/git ~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Format - name: Format
run: cargo +stable fmt --all -- --check run: cargo +stable fmt --all -- --check
clippy-check: clippy-check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Rust toolchain - name: Rust toolchain
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:
components: clippy components: clippy
- name: Cargo cache - name: Cargo cache
uses: actions/cache@v5 uses: actions/cache@v5
with: with:
path: | path: |
~/.cargo/registry ~/.cargo/registry
~/.cargo/git ~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: System dependencies - name: System dependencies
run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libdisplay-info-dev run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libdisplay-info-dev
- name: Clippy - name: Clippy
run: cargo +stable clippy -- -D warnings run: cargo +stable clippy --all-features -- -D warnings
check-features: check-features:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Rust toolchain - name: Rust toolchain
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
- name: Cargo cache - name: Cargo cache
uses: actions/cache@v5 uses: actions/cache@v5
with: with:
path: | path: |
~/.cargo/registry ~/.cargo/registry
~/.cargo/git ~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: System dependencies - name: System dependencies
run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libdisplay-info-dev run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libdisplay-info-dev
- run: cargo +stable check --no-default-features - run: cargo +stable check --no-default-features
- run: cargo +stable check --features debug - run: cargo +stable check --features debug
- run: cargo +stable check --features profile-with-tracy - run: cargo +stable check --features profile-with-tracy
- run: cargo +stable check --features profile-with-tracy-gpu
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Rust toolchain - name: Rust toolchain
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
- name: Cargo cache - name: Cargo cache
uses: actions/cache@v5 uses: actions/cache@v5
with: with:
path: | path: |
~/.cargo/registry ~/.cargo/registry
~/.cargo/git ~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: System dependencies - name: System dependencies
run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libdisplay-info-dev libpixman-1-dev meson ninja-build run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libdisplay-info-dev libpixman-1-dev meson ninja-build
- name: Build cache - name: Build cache
uses: actions/cache@v5 uses: actions/cache@v5
with: with:
path: target path: target
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.toml') }} key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.toml') }}
- name: Build and install Libseat - name: Build and install Libseat
run: | run: |
wget https://git.sr.ht/~kennylevinsen/seatd/archive/0.9.1.tar.gz -O libseat-source.tar.gz wget https://git.sr.ht/~kennylevinsen/seatd/archive/0.9.1.tar.gz -O libseat-source.tar.gz
tar xf libseat-source.tar.gz tar xf libseat-source.tar.gz
cd seatd-0.9.1 cd seatd-0.9.1
meson setup -Dlibseat-builtin=enabled -Dserver=disabled -Dexamples=disabled -Dman-pages=disabled build . meson setup -Dlibseat-builtin=enabled -Dserver=disabled -Dexamples=disabled -Dman-pages=disabled build .
ninja -C build ninja -C build
sudo meson install -C build sudo meson install -C build
sudo ldconfig sudo ldconfig
- name: Test features - name: Test features
env: env:
RUST_BACKTRACE: full RUST_BACKTRACE: full
run: cargo test --all-features run: cargo test --all-features