diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fd0bc8..193f0fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,3 +55,58 @@ jobs: command: test args: --all-features --verbose + clippy: + name: clippy (ubuntu-latest, stable) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install latest stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: clippy + + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} + + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargoo.lock') }} + + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('Cargo.lock') }} + + - name: Check clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings + + fmt: + name: fmt (ubuntu-latest, stable) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install latest stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt + + - name: Check format + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check diff --git a/README.md b/README.md index d7fb52a..1d6539a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Sonic Channel +[![Build](https://github.com/pleshevskiy/sonic-channel/actions/workflows/ci.yml/badge.svg)](https://github.com/pleshevskiy/sonic-channel/actions/workflows/ci.yml) [![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/) [![Documentation](https://docs.rs/sonic-channel/badge.svg)](https://docs.rs/sonic-channel) [![Crates.io](https://img.shields.io/crates/v/sonic-channel)](https://crates.io/crates/sonic-channel)