Skip to content

Commit f57031c

Browse files
committed
ci: add fmt checks and make as steps
1 parent d38825a commit f57031c

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

.github/workflows/clippy.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,48 @@ on:
66
- main
77

88
jobs:
9-
clippy:
9+
fmt:
1010
runs-on: ubuntu-22.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions-rs/toolchain@v1
14+
with:
15+
profile: minimal
16+
toolchain: stable
17+
override: true
18+
- run: rustup component add rustfmt
19+
- uses: actions-rs/cargo@v1
20+
with:
21+
command: fmt
22+
args: --all -- --check
23+
24+
leptosfmt:
25+
runs-on: ubuntu-22.04
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions-rs/toolchain@v1
29+
with:
30+
profile: minimal
31+
toolchain: nightly
32+
override: true
33+
components: clippy
34+
- name: Cache .cargo and target
35+
uses: actions/cache@v2
36+
with:
37+
path: |
38+
~/.cargo
39+
key: ${{ runner.os }}-cargo-leptos-${{ hashFiles('**/Cargo.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-cargo-leptos-${{ hashFiles('**/Cargo.lock') }}
42+
${{ runner.os }}-cargo-leptos
43+
- name: Install LeptosFmt
44+
run: cargo install leptosfmt --version 0.1.13
45+
- name: Check LeptosFmt
46+
run: leptosfmt --check .
1147

48+
clippy:
49+
needs: [ fmt, leptosfmt ]
50+
runs-on: ubuntu-22.04
1251
steps:
1352
- uses: actions/checkout@v2
1453

0 commit comments

Comments
 (0)