name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build & Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libdbus-1-dev pkg-config
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Format check
if: matrix.os == 'ubuntu-latest'
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Test
run: cargo test --all --all-features --quiet
- name: Install cargo-deny
if: matrix.os == 'ubuntu-latest'
run: cargo install cargo-deny --locked
- name: Cargo deny (licenses and bans)
if: matrix.os == 'ubuntu-latest'
run: cargo deny check licenses bans
- name: Build docs (docsrs cfg)
if: matrix.os == 'ubuntu-latest'
env:
RUSTDOCFLAGS: "--cfg docsrs"
run: cargo doc --all-features --no-deps
- name: Check clippy pedantic (all targets)
if: matrix.os == 'ubuntu-latest'
run: cargo clippy --features full -- -W clippy::pedantic