File tree Expand file tree Collapse file tree 1 file changed +31
-12
lines changed
Expand file tree Collapse file tree 1 file changed +31
-12
lines changed Original file line number Diff line number Diff line change 1919
2020 steps :
2121 - uses : actions/checkout@v3
22+
23+ # 新增:检查代码格式
24+ - name : fmt
25+ uses : actions-rs/cargo@v1
26+ with :
27+ command : fmt
28+ # --check 参数让命令在发现未格式化的代码时失败,而不是直接修改文件
29+ args : -- --check
30+
31+ # 新增:运行 Clippy lints
32+ - name : clippy
33+ uses : actions-rs/cargo@v1
34+ with :
35+ command : clippy
36+ # --all-features 确保检查所有特性门控后的代码
37+ # -- -D warnings 将所有 Clippy 警告(warnings)视为错误(Deny),导致 CI 失败
38+ args : --all-features -- -D warnings
39+
40+ # 原有的步骤保持不变
2241 - name : Install tools
2342 uses : actions-rs/cargo@v1
2443 with :
@@ -39,16 +58,16 @@ jobs:
3958 with :
4059 command : package
4160
42- publish :
43- runs-on : ubuntu-latest
44- needs : [build]
45- if : startsWith(github.ref, 'refs/tags/')
61+ # publish:
62+ # runs-on: ubuntu-latest
63+ # needs: [build]
64+ # if: startsWith(github.ref, 'refs/tags/')
4665
47- steps :
48- - uses : actions/checkout@v3
49- - name : Publish to Crates.io
50- uses : actions-rs/cargo@v1
51- with :
52- command : publish
53- env :
54- CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
66+ # steps:
67+ # - uses: actions/checkout@v3
68+ # - name: Publish to Crates.io
69+ # uses: actions-rs/cargo@v1
70+ # with:
71+ # command: publish
72+ # env:
73+ # CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
You can’t perform that action at this time.
0 commit comments