name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run tests with async feature
run: cargo test --verbose --features async
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install clippy
run: rustup component add clippy
- name: Clippy check
run: cargo clippy -- -D warnings
- name: Clippy check with async feature
run: cargo clippy --features async -- -D warnings
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install rustfmt
run: rustup component add rustfmt
- name: Check code formatting
run: cargo fmt --all -- --check