Skip to content

lint

lint #475

Workflow file for this run

name: lint
on:
push:
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "**/Cargo.lock"
- ".github/workflows/lint.yml"
pull_request:
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "**/Cargo.lock"
- ".github/workflows/lint.yml"
workflow_dispatch:
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full
CARGO_TERM_COLOR: always
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install clippy and rustfmt
run: |
rustup component add clippy
rustup component add rustfmt
- name: Log versions
run: |
rustc --version
cargo --version
- name: Configure cargo data directory
run: |
echo "CARGO_HOME=$(pwd)/.cargo_home" >> $GITHUB_ENV
- name: Cache
uses: actions/cache@v2
with:
path: |-
.cargo_home
target/*/.*
target/*/build
target/*/deps
key: ${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.os }}-
- name: Run cargo fmt
run: make format-check
- name: Run cargo check
run: make check
- name: Run cargo clippy
run: make lint