name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 - uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6
- name: Format
run: cargo fmt --all -- --check
- name: Clippy (default features)
run: cargo clippy --all-targets -- -D warnings
- name: Clippy (all features)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Test (default features)
run: cargo test
- name: Test (all features)
run: cargo test --all-features
- name: Examples
run: cargo clippy --examples --all-features -- -D warnings
- name: Run examples
run: |
cargo run --quiet --example basic
cargo run --quiet --example precedence
cargo run --quiet --example typed
cargo run --quiet --example custom_source
- name: Docs
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings
deny:
name: cargo-deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 - uses: EmbarkStudios/cargo-deny-action@3c6349835b2b7b196a839186cb8b78e02f7b5f25 with:
command: check advisories bans sources licenses