ci: update CI workflows

This commit is contained in:
Kristofers Solo 2025-09-25 10:43:12 +03:00
parent e20000513a
commit 6f60d8f5f1
Signed by: kristoferssolo
GPG Key ID: 74FF8144483D82C8

View File

@ -9,112 +9,31 @@ env:
RUSTFLAGS: --deny warnings RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings RUSTDOCFLAGS: --deny warnings
jobs: jobs:
# Run tests build-and-test:
test:
name: Tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30 env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps: steps:
- name: Checkout repository - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Rust toolchain - name: Install Rust
uses: dtolnay/rust-toolchain@stable uses: actions-rs/toolchain@v1
- name: Install dependencies
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: with:
sweep-cache: true profile: minimal
toolchain: stable
override: true
- name: Run sccache-cache
uses: mozilla-actions/sccache-actions@0.0.9
- name: Install cargo-nextest - name: Install cargo-nextest
run: cargo install cargo-nextest --locked uses: taiki-e/install-action@cargo-nextest
- name: Run tests with nextest - name: Run Clippy
run: cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
- name: Run formatting
run: cargo fmt --all --check
- name: Run Tests
run: | run: |
cargo nextest run \ cargo nextest run --all-features --all-targets
--all-features \ cargo test --locked --workspace --all-features --doc
--all-targets - name: Check Documentation
# Workaround for https://github.com/rust-lang/cargo/issues/6669 run: cargo doc --locked --workspace --all-features --document-private-items --no-deps
cargo test \
--locked \
--workspace \
--all-features \
--doc
# Run clippy lints
clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
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
- 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
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run cargo fmt
run: |
cargo fmt \
--all \
-- \
--check
# Check documentation
doc:
name: Docs
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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
- 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