Skip to content

Commit 381ef5c

Browse files
authored
update rust.yml
add caching to clippy and move up fmt
1 parent 3e2d555 commit 381ef5c

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/rust.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,31 @@ defaults:
2020

2121
jobs:
2222

23-
clippy:
23+
fmt:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- uses: actions/checkout@v4
2727
- name: Check the rustup version
2828
run: rustup --version
29-
- name: Clippy
30-
run: cargo clippy -- --deny warnings
29+
- name: rustfmt
30+
run: cargo fmt --all --check
3131

32-
fmt:
32+
clippy:
3333
runs-on: ubuntu-latest
3434
steps:
3535
- uses: actions/checkout@v4
36+
- name: Cache
37+
uses: actions/cache@v4
38+
with:
39+
path: |
40+
~/.cargo/registry
41+
~/.cargo/git
42+
target
43+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
3644
- name: Check the rustup version
3745
run: rustup --version
38-
- name: rustfmt
39-
run: cargo fmt --all --check
46+
- name: Clippy
47+
run: cargo clippy -- --deny warnings
4048

4149
build:
4250
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)