name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out
uses: actions/checkout@v4
- name: Install or Update Rust
run:
rustup update
- name: Check rust code formatting
run: cargo fmt --check --all
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out
uses: actions/checkout@v4
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Install or Update Rust
run:
rustup update
- name: Lint
run: cargo clippy --all-targets -- -D warnings
- name: Lint (Tokio)
run: cargo clippy --all-targets --features=tokio -- -D warnings
- name: Lint (async-io)
run: cargo clippy --all-targets --features=async-io-2 -- -D warnings
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out
uses: actions/checkout@v4
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Install or Update Rust
run: rustup update
- name: Build
run: cargo build --all-targets
- name: Run Tests
run: cargo test --workspace
- name: Run Tests (Tokio)
run: cargo test --features=tokio
- name: Run Tests
run: cargo test --features=async-io-2
- name: Run example (async-std)
run: cargo run --features=async-io-2 --example async-std