Skip to content

Commit e917e3a

Browse files
authored
Create rust.yml
1 parent 35487bc commit e917e3a

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/rust.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Rust CI
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
branches: ['**']
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
# 检出代码
15+
- uses: actions/checkout@v3
16+
17+
# 设置Rust工具链为stable版本
18+
- name: Setup Rust
19+
uses: actions-rs/toolchain@v1
20+
with:
21+
toolchain: stable
22+
override: true
23+
24+
# 编译项目
25+
- name: Build
26+
run: cargo build --verbose
27+
28+
# 运行测试
29+
- name: Run Tests
30+
run: cargo test --verbose
31+
32+
# 检查代码格式
33+
- name: Check Formatting
34+
run: cargo fmt -- --check
35+
36+
# 静态代码分析
37+
- name: Lint with Clippy
38+
uses: actions-rs/clippy-check@v1

0 commit comments

Comments
 (0)