name: CI
on:
push:
branches: [master]
pull_request:
schedule:
- cron: "17 3 * * 1"
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: build & test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
if: github.event_name != 'schedule'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Install Linux system deps
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
pkg-config libclang-dev \
libxcb1-dev libxrandr-dev libdbus-1-dev \
libpipewire-0.3-dev libwayland-dev libegl-dev libgbm-dev
- name: Format check
run: cargo fmt --all --check
- name: Build (default features)
run: cargo build --release
- name: Test (default features)
run: cargo test --release
- name: Test (parallel)
run: cargo test --release --features parallel
- name: Test (all features) [windows]
if: matrix.os == 'windows-latest'
run: cargo test --release --all-features
- name: Test (match-corr) [linux]
if: matrix.os == 'ubuntu-latest'
run: cargo test --release --features match-corr
- name: Test (match-corr + parallel) [linux]
if: matrix.os == 'ubuntu-latest'
run: cargo test --release --features match-corr,parallel
- name: Test (tracing) [linux]
if: matrix.os == 'ubuntu-latest'
run: cargo test --release --features tracing
- name: Clippy (default features)
run: cargo clippy --release --all-targets -- -D warnings
- name: Clippy (all features) [windows]
if: matrix.os == 'windows-latest'
run: cargo clippy --release --all-targets --all-features -- -D warnings
- name: Clippy (match-corr) [linux]
if: matrix.os == 'ubuntu-latest'
run: cargo clippy --release --all-targets --features match-corr -- -D warnings
- name: Rustdoc (warnings are errors) [windows]
if: matrix.os == 'windows-latest'
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --all-features
- name: Rustdoc (warnings are errors) [linux]
if: matrix.os == 'ubuntu-latest'
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --features match-corr,parallel,tracing
msrv:
name: build on MSRV (1.88)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.88
- uses: Swatinem/rust-cache@v2
- name: Install Linux system deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
pkg-config libclang-dev \
libxcb1-dev libxrandr-dev libdbus-1-dev \
libpipewire-0.3-dev libwayland-dev libegl-dev libgbm-dev
- name: Build (default features)
run: cargo build --release