This repository was archived by the owner on Feb 19, 2026. It is now read-only.
fix(ci): components #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: rust-ci | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| ci: | |
| name: CI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| # 1. 代码格式化检查 | |
| - name: Run rustfmt | |
| run: cargo fmt --all -- --check | |
| # 2. 代码质量检查 | |
| - name: Run clippy | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| # 3. 构建项目 | |
| - name: Build workspace | |
| run: cargo build --workspace --release | |
| # 4. 运行测试 | |
| - name: Run tests | |
| run: cargo test --workspace --all-features --all-targets --no-fail-fast | |
| # 5. 安装 cargo-deny | |
| - name: Install cargo-deny | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-deny | |
| # 6. 安全检查 | |
| - name: Run cargo-deny (advisories) | |
| run: cargo deny check advisories | |
| - name: Run cargo-deny (licenses) | |
| run: cargo deny check licenses | |
| - name: Run cargo-deny (bans) | |
| run: cargo deny check bans | |
| - name: Run cargo-deny (sources) | |
| run: cargo deny check sources | |