linutil/.github/workflows/rust.yml

45 lines
1007 B
YAML
Raw Normal View History

name: Rust Checks
2024-07-13 22:58:12 +01:00
on:
pull_request:
branches: ["main"]
2024-09-18 19:59:10 +01:00
paths:
- '**/*.rs'
- '**/Cargo.toml'
2024-09-18 19:59:10 +01:00
- 'Cargo.lock'
2024-07-13 22:58:12 +01:00
env:
CARGO_TERM_COLOR: always
jobs:
lints:
2024-07-19 17:45:13 +01:00
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-registry-
- name: Cache Cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-index-
- name: Run cargo clippy
run: cargo clippy -- -Dwarnings
- name: Run cargo fmt
run: cargo fmt --all --check