Skip to content

Commit 310ba94

Browse files
committed
Add fmt, clippy in CI
Signed-off-by: Arshdeep54 <balarsh535@gmail.com>
1 parent 4ed25fb commit 310ba94

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/rust.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Rust CI
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
branches: ['**']
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build_and_test:
14+
name: Build and Test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set Up Rust
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
components: clippy, rustfmt
25+
override: true
26+
27+
- name: Cache Cargo Dependencies
28+
uses: Swatinem/rust-cache@v2
29+
30+
- name: Check Code Formatting
31+
run: cargo fmt --all -- --check
32+
33+
- name: Run Clippy (Linter)
34+
run: cargo clippy --all-targets --all-features -- -D warnings
35+
36+
- name: Build Project
37+
run: cargo build --verbose
38+
39+
- name: Run Tests
40+
run: cargo test --verbose

0 commit comments

Comments
 (0)