ci-fix
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCI Fix Skill
CI修复技能
Diagnose and fix GitHub Actions CI failures using patterns from past CI issues.
利用过往CI问题中的模式,诊断并修复GitHub Actions CI失败问题。
Quick Diagnosis Pattern
快速诊断流程
- Get CI status:
bash
gh run list --limit 5 --json status,conclusion,name,headBranch- Get failed job logs:
bash
gh run view <run_id> --log --job <job_name>- Categorize failure:
- lint: fmt/clippy warnings
- test: test failures or timeouts
- build: compilation errors
- security: cargo audit/deny failures
- coverage: coverage threshold missed
- deprecated: old action versions (common!)
- 获取CI状态:
bash
gh run list --limit 5 --json status,conclusion,name,headBranch- 获取失败任务日志:
bash
gh run view <run_id> --log --job <job_name>- 分类失败类型:
- lint:fmt/clippy警告
- test:测试失败或超时
- build:编译错误
- security:cargo audit/deny检查失败
- coverage:未达覆盖率阈值
- deprecated:旧版Action(常见问题!)
Common Fixes (From History)
常见修复方案(来自历史案例)
Deprecated GitHub Actions
已弃用的GitHub Actions
bash
undefinedbash
undefinedDetect
检测
grep -r "actions/checkout@v1" .github/workflows/
grep -r "actions-rs" .github/workflows/
grep -r "actions/checkout@v1" .github/workflows/
grep -r "actions-rs" .github/workflows/
Fix: Update to v2+
修复:升级到v2+版本
undefinedundefinedOptional Dependency Issues (libclang, wasmtime)
可选依赖问题(libclang, wasmtime)
bash
undefinedbash
undefinedPattern: --all-features triggered optional dep issues
问题模式:--all-features触发可选依赖问题
Fix: Use workspace exclude
修复:使用工作区排除
cargo build --workspace --exclude memory-mcp
undefinedcargo build --workspace --exclude memory-mcp
undefinedClippy Lint Allow-List
Clippy代码检查允许列表
bash
undefinedbash
undefinedSee new warnings
查看新警告
cargo clippy --all -- -D warnings | grep "warning:"
cargo clippy --all -- -D warnings | grep "warning:"
Fix: Add #[allow(...)] comments
修复:添加#[allow(...)]注释
undefinedundefinedCoverage Threshold
覆盖率阈值
bash
undefinedbash
undefinedGenerate coverage
生成覆盖率报告
cargo tarpaulin --workspace
cargo tarpaulin --workspace
Check threshold in .github/workflows/
检查工作流文件中的阈值设置
undefinedundefinedBenchmark Timeout
基准测试超时
bash
undefinedbash
undefinedIncrease timeout-minutes in workflow YAML
在工作流YAML中增加timeout-minutes
undefinedundefinedFix Commands
修复命令
bash
undefinedbash
undefinedLinting
代码检查
cargo fmt --all
cargo clippy --workspace --fix --allow-dirty
cargo fmt --all
cargo clippy --workspace --fix --allow-dirty
Testing
测试
cargo test --workspace -- --nocapture
cargo test --workspace -- --nocapture
Security
安全检查
cargo audit
cargo deny check
cargo audit
cargo deny check
Build
构建
cargo build --workspace
undefinedcargo build --workspace
undefinedSuccess Criteria
成功标准
- All CI jobs pass
- No new warnings introduced
- Changes committed if needed
- 所有CI任务通过
- 未引入新警告
- 必要时提交变更