name: CI
on:
push:
branches:
- main
paths-ignore:
- 'README'
- 'COPYRIGHT'
- 'LICENSE-*'
- '**.md'
- '**.txt'
pull_request:
paths-ignore:
- 'README'
- 'COPYRIGHT'
- 'LICENSE-*'
- '**.md'
- '**.txt'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: 1
jobs:
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- name: cargo fmt --check
run: cargo fmt --all -- --check
clippy-macos:
name: clippy (macos)
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Cache cargo build and registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: macos-clippy-${{ hashFiles('**/Cargo.lock', 'Cargo.toml') }}
restore-keys: |
macos-clippy-
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add clippy
- name: Install cargo-hack
run: cargo install --locked cargo-hack
- name: clippy --each-feature (-D warnings)
run: cargo hack clippy --each-feature --tests --no-deps -- -D warnings
test-macos:
name: test (macos)
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Cache cargo build and registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: macos-test-${{ hashFiles('**/Cargo.lock', 'Cargo.toml') }}
restore-keys: |
macos-test-
- name: Install Rust
run: rustup update stable && rustup default stable
- name: cargo test --all-features
run: cargo test --all-features --lib --no-fail-fast
doc-macos:
name: doc (macos)
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Cache cargo build and registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: macos-doc-${{ hashFiles('**/Cargo.lock', 'Cargo.toml') }}
restore-keys: |
macos-doc-
- name: Install Rust
run: rustup update stable && rustup default stable
- name: cargo doc --all-features --no-deps
env:
RUSTDOCFLAGS: -Dwarnings
run: cargo doc --all-features --no-deps
build-stub-linux:
name: build stub (linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust
run: rustup update stable && rustup default stable
- name: cargo check --all-features (cfg-gated stub)
run: cargo check --all-features