name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test Suite (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target/
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-build-target-
- name: Install Dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libx11-dev \
libasound2-dev \
libudev-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libwayland-dev \
libxkbcommon-dev \
libvulkan-dev
- name: Install Dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
# Install any macOS-specific dependencies if needed
brew install pkg-config
- name: Install Dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
# Windows-specific setup if needed
echo "Windows dependencies setup"
- name: Run cargo test
run: cargo test --all-features
- name: Run cargo test (no default features)
run: cargo test --no-default-features --all-features
- name: Run doc tests
run: cargo test --doc --all-features
clippy_check:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-clippy-
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libx11-dev \
libasound2-dev \
libudev-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libwayland-dev \
libxkbcommon-dev \
libvulkan-dev
- name: Run clippy
run: cargo clippy --all-features -- -D warnings
- name: Check clippy on examples
run: cargo clippy --examples --all-features -- -D warnings
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4.2.2
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Check TOML formatting
run: cargo install --quiet taplo-cli && taplo fmt --check
security:
name: Security Audit
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4.2.2
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-audit
uses: taiki-e/install-action@cargo-audit
- name: Security audit
run: >
cargo audit
--ignore RUSTSEC-2026-0104
--ignore RUSTSEC-2026-0049
--ignore RUSTSEC-2026-0098
--ignore RUSTSEC-2026-0099
--ignore RUSTSEC-2025-0134