Skip to content

Commit c4392a7

Browse files
committed
basic ci
1 parent 3b96ba5 commit c4392a7

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/pr.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: PR Check
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build-and-test:
11+
name: Build and Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Cache cargo registry
19+
uses: actions/cache@v4
20+
with:
21+
path: |
22+
~/.cargo/registry
23+
~/.cargo/git
24+
target
25+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
26+
27+
- name: Build project
28+
run: cargo build --release
29+
30+
- name: Install Rust deps
31+
run: rustup install nightly-2025-05-14 && rustup component add rust-src --toolchain nightly-2025-05-14
32+
33+
- name: Run tests
34+
run: cargo test --release
35+
36+
clippy:
37+
name: Clippy
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v4
43+
44+
- name: Run Clippy
45+
run: cargo clippy --all-targets --all-features -- -D warnings
46+
47+
fmt:
48+
name: Rustfmt
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- name: Checkout code
53+
uses: actions/checkout@v4
54+
55+
- name: Check formatting
56+
run: cargo fmt --all -- --check

0 commit comments

Comments
 (0)