-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (41 loc) · 1.19 KB
/
lint.yaml
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
45
46
47
48
# Rust template: https://github.com/actions/starter-workflows/blob/main/ci/rust.yml
# Resources: https://docs.github.com/en/actions
# Examples: https://github.com/actions/starter-workflows
# Process: make small changes, push them, check the Actions tab on github
# also see templates https://github.com/rust-github/template/tree/main/.github/workflows
name: Lint
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always # pretty colors
jobs:
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: clippy
override: true
- name: cargo clippy
run: cargo clippy
fmt:
name: fmt project
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- nightly
steps:
- name: checkout repo
uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check