-
Notifications
You must be signed in to change notification settings - Fork 11
44 lines (41 loc) · 1.07 KB
/
rust.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
37
38
39
40
41
42
43
44
name: Lint & Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check build
# Ensure we didn't forget to push the `Cargo.lock` changes using `--locked`.
run: cargo --locked check
lint:
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
RUST_BACKTRACE: full
RUST_LOG: trace
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt -- --check
- name: Catch common mistakes and unwrap calls
run: cargo clippy -- -D warnings