ci: add clippy and fmt actions

This commit is contained in:
Dmitriy Pleshevskiy 2022-07-21 10:04:29 +03:00
parent cd10bf3cba
commit e651d12398
2 changed files with 56 additions and 0 deletions

View file

@ -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

View file

@ -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)