docs: add lib docs

This commit is contained in:
2025-07-14 21:30:58 +03:00
parent cd8fd27e69
commit 748db052ff
2 changed files with 128 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ env:
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
jobs:
# Run tests.
# Run tests
test:
name: Tests
runs-on: ubuntu-latest
@@ -20,17 +20,29 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends \
libasound2-dev libudev-dev libwayland-dev \
libxkbcommon-dev
- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: Run tests
- name: Install cargo-nextest
run: cargo install cargo-nextest --locked
- name: Run tests with nextest
run: |
cargo test --locked --workspace --all-features --all-targets
cargo nextest run \
--all-features \
--all-targets
# Workaround for https://github.com/rust-lang/cargo/issues/6669
cargo test --locked --workspace --all-features --doc
# Run clippy lints.
cargo test \
--locked \
--workspace \
--all-features \
--doc
# Run clippy lints
clippy:
name: Clippy
runs-on: ubuntu-latest
@@ -43,14 +55,24 @@ jobs:
with:
components: clippy
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends \
libasound2-dev libudev-dev libwayland-dev \
libxkbcommon-dev
- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: Run clippy lints
run: cargo clippy --locked --workspace --all-features -- --deny warnings
# Check formatting.
run: |
cargo clippy \
--locked \
--workspace \
--all-features \
-- \
--deny warnings
# Check formatting
format:
name: Format
runs-on: ubuntu-latest
@@ -63,8 +85,12 @@ jobs:
with:
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
# Check documentation.
run: |
cargo fmt \
--all \
-- \
--check
# Check documentation
doc:
name: Docs
runs-on: ubuntu-latest
@@ -75,10 +101,22 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends \
libasound2-dev libudev-dev libwayland-dev \
libxkbcommon-dev
- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: Check documentation
run: cargo doc --locked --workspace --all-features --document-private-items --no-deps
run: |
cargo doc \
--locked \
--workspace \
--all \
--features \
--document-private \
--items \
--no-deps