-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (36 loc) · 1.09 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Rust test & lint
permissions:
contents: read
checks: write
on:
push:
branches: '*'
pull_request:
env:
RUST_VERSION: 1.74.0
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
run: |
rustup toolchain install ${RUST_VERSION} --profile minimal --no-self-update --component rustfmt clippy
rustup default ${RUST_VERSION}
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Execute all unit and integration tests and build examples
run: cargo test
- name: Check formatting of code and suggest improvements
run: cargo fmt -- --check
- name: Check for common mistakes and code improvements
run: cargo clippy --all-targets --all-features -- -D warnings