Skip to content

Commit cc10637

Browse files
committed
feat(ci): add GitHub Actions workflow for CI
Add a comprehensive CI workflow that includes: - Code checking with cargo check - Formatting validation with cargo fmt - Linting with cargo clippy - Unit testing with cargo test - Rust toolchain setup and caching - Support for both push and pull request events
1 parent 073286e commit cc10637

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
check:
14+
name: Check
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: dtolnay/rust-toolchain@stable
19+
- uses: Swatinem/rust-cache@v2
20+
- run: cargo check
21+
22+
fmt:
23+
name: Format
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: dtolnay/rust-toolchain@stable
28+
with:
29+
components: rustfmt
30+
- run: cargo fmt -- --check
31+
32+
clippy:
33+
name: Clippy
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: dtolnay/rust-toolchain@stable
38+
with:
39+
components: clippy
40+
- uses: Swatinem/rust-cache@v2
41+
- run: cargo clippy -- -D warnings
42+
43+
test:
44+
name: Test
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: dtolnay/rust-toolchain@stable
49+
- uses: Swatinem/rust-cache@v2
50+
- run: cargo test --lib

0 commit comments

Comments
 (0)