-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1.36 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: CI
# 🔗CI语法参考:https://docs.github.com/zh/actions/writing-workflows/workflow-syntax-for-github-actions
# ! 📌【2024-09-13 23:41:22】不建议在`name`中附带空格:会影响到shields.io中的badge链接
on:
push: # 推送到特定分支
branches:
- main
# - dev # ! ❌【2024-09-14 12:23:09】目前禁用:`dev`分支用于快速开发,没必要在推送时触发CI
- 'test**'
label: # 创建标签
types:
- created
pull_request: # 拉取请求
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: setup toolchain
uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
# * ✅【2024-09-14 16:14:07】目前没有平台特异性:所有测试在Ubuntu中也有效
- name: cargo test
run: cargo test --all-features
- name: rustfmt
run: cargo fmt --all -- --check
- name: clippy
run: cargo clippy --all --all-features --tests -- -D warnings
# 📌【2024-08-25 00:23:12】暂不启用``参数:暂且不对clippy采取过于严格的限制
# 📝【2024-08-25 00:33:21】现在可在Cargo.toml中 允许特定clippy限制(诸如:放宽对文档注释的要求)