update lint action #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: | |
pull_request: | |
runs: | |
using: composite | |
steps: | |
- name: Setup Rust | |
uses: dtolnay/[email protected] | |
with: | |
components: clippy,rustfmt | |
- name: Check rust version after install | |
run: | | |
rustc --version; | |
cargo --version; | |
cargo clippy --version; | |
cargo fmt --version; | |
shell: bash | |
- name: Setup rust lint cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/ | |
target/ | |
key: ${{ runner.os }}-cargo-lint-${{ hashFiles('**/Cargo.lock') }} | |
- name: Setup Rust tools | |
run: cargo install cargo-sort --locked | |
shell: bash | |
- name: Cargo sort | |
run: cargo sort --workspace --check | |
shell: bash | |
- name: Cargo fmt | |
run: cargo fmt --all --check | |
shell: bash | |
- name: Clippy check | |
run: cargo clippy --all-features --all-targets --tests -- -D warning |