Skip to content

ci: added Rust CI workflow #1

ci: added Rust CI workflow

ci: added Rust CI workflow #1

Workflow file for this run

name: Rust
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
on:
push:
paths-ignore:
- "**.md"
- "**.py"
pull_request:
paths-ignore:
- "**.md"
- "**.py"
workflow_dispatch:
jobs:
check-fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: rustup component add clippy
- run: cargo clippy --all-targets -- --deny warnings
check-docs:
name: cargo doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo doc --no-deps --document-private-items
env: {RUSTDOCFLAGS: -D warnings}
linux-build:
name: linux build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# Check that crates build without default features
- run: cargo check --workspace --no-default-features
# Check that crates build with default features
- run: cargo check --workspace
# Check that crates build with all features
- run: cargo check --workspace --all-features
linux-test:
name: linux test
needs: [linux-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --all-targets
doc-tests:
name: doc tests
needs: [linux-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --doc