2024-07-19 17:22:21 +01:00
|
|
|
name: Rust Checks
|
2024-07-13 22:58:12 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2024-07-31 04:40:25 +01:00
|
|
|
branches: ["main"]
|
2024-09-18 19:59:10 +01:00
|
|
|
paths:
|
|
|
|
- '**/*.rs'
|
2024-10-31 18:21:06 +00:00
|
|
|
- '**/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:
|
2024-07-19 17:22:21 +01:00
|
|
|
lints:
|
2024-07-19 17:45:13 +01:00
|
|
|
name: Lints
|
2024-07-19 17:22:21 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-07-31 04:40:25 +01:00
|
|
|
- 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
|
2024-09-21 15:08:24 +01:00
|
|
|
run: cargo clippy -- -Dwarnings
|
2024-07-31 04:40:25 +01:00
|
|
|
|
|
|
|
- name: Run cargo fmt
|
|
|
|
run: cargo fmt --all --check
|