已合并
update actions files,add post action #1389
Larry创建于 27 天前
update actions files,add post action #1389
已合并
从已删除 :master合入到cann/pto-isamaster
Pull Request已成功合入, 合并人@CANN-robot
(感谢 Larry 的贡献)atomgit-bot
27 天前 评论:
27 天前 评论:
变更摘要
此 PR 主要对 actions 流水线配置进行了系统性优化,包括:将编译/UT 脚本中的架构判断从 task_name 迁移到新的 ge_st_rt2 变量;将 shell 脚本的错误处理模式从 set +e 改为 set -e 并引入断言函数;将 .run 包的验证逻辑从 compile.sh 脚本中提取到工作流级别,复用外部 verify-package action;同时统一了工作流命名、运行环境配置及 checkout ref 的引用方式。
主要改动
- 脚本错误处理加固:
compile.sh和ut.sh从set +e改为set -e配合set -o pipefail,compile.sh新增DP_ASSERT_EQUAL断言函数替代原有的手动ret检查和exit模式,使构建失败能立即终止并输出明确的对比信息。 - 架构判断变量迁移:所有脚本和工作流中将架构/平台判断从
task_name(如*A5*、== "A3")改为统一的ge_st_rt2变量(值为A3/A5),由调用方工作流PR-pipeline_pto-isa.yml在with参数中传入,compile_action.yml和llt_action.yml新增ge_st_rt2输入参数并导出为环境变量。 - 编译产物处理重构:
compile.sh删除了包重命名、安装验证、卸载验证及目录清理等约 60 行逻辑,改为在工作流compile_action.yml中新增rename_package和verify_package步骤(后者复用外部cann/.gitcode/actions/verify-package@masteraction);A5 架构的编译任务跳过包验证和 OBS 上传。 - 工作流配置规范化:
PR-pipeline_pto-isa.yml中repo_name从pt-isa修正为pto-isa,runner 从codearts-hosted改为dedicate-hosted并指定容器镜像,所有 checkout 步骤的ref统一为${{ atomgit.event.pull_request.merge_commit_sha }};三个 action 工作流名称分别改为更具辨识度的compile_action、UT、StaticCheck。 - UT 流程调整:
ut.sh新增 Python 3.10 路径导出和 Ascend CANN 环境 source(/home/jenkins/Ascend/cann/bin/setenv.bash),A5 的 UT 执行参数移除了-a标志(从-a -r npu -v a5变为-r npu -v a5)。


atomgit-bot
27 天前 评论:
27 天前 评论:
代码审查
审查总结
本次审查覆盖全部 7 个变更文件,共发现 8 个问题:
| 优先级 | 数量 | 说明 |
|---|---|---|
| P2 | 4 | 错误处理逻辑不可达、checkout 回退移除导致 workflow_dispatch 失败、artifact-path 表达式语法存疑 |
| P3 | 4 | 词分割风险、笔误、缺少 local 声明、缺少无文件错误处理 |
各文件审查结果
| 文件 | 发现数 | 结论 |
|---|---|---|
.gitcode/scripts/compile.sh |
4 (P2×1, P3×3) | LOG_DO 重构引入了多个问题:${cmd} 未加引号、尾部多余 $、缺少 local;set -e 与 DP_ASSERT_EQUAL 组合使错误断言不可达 |
.gitcode/scripts/ut.sh |
1 (P2) | set -e 使 if [[ ${ret} -ne 0 ]] 错误检查不可达 |
.gitcode/scripts/pre_smoke.sh |
0 | 仅删除注释行,无问题 |
.gitcode/workflows/PR-pipeline_pto-isa.yml |
1 (P2) | checkout ref 移除 || atomgit.sha 回退 |
.gitcode/workflows/compile_action.yml |
3 (P2×2, P3×1) | ref 回退移除、artifact-path 表达式语法存疑、rename_package 缺错误处理 |
.gitcode/workflows/llt_action.yml |
1 (P2) | 同 ref 回退移除(已合并至跨文件报告) |
.gitcode/workflows/staticcheck_action.yml |
1 (P2) | 同 ref 回退移除(已合并至跨文件报告) |
整体风险评估
中等风险。最值得关注的问题是:set -e 与手动错误检查的冲突(P2)——虽然构建失败时脚本仍会退出,但自定义错误消息被静默吞掉,排查效率下降;|| atomgit.sha 回退的移除(P2)——会导致 workflow_dispatch 手动触发场景下 checkout 失败。建议在合入前优先修复这两个 P2 问题。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 3 |
💬 仅评论


27 天前 添加了label:cann-cla/yes
CANN-robot
27 天前 评论:
27 天前 评论:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| .gitcode | ✅ 宋常霞, tanghaoran7 (2/2) | ✅ 宋常霞 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Larry_liuyi, thanks for your pull request. All authors of the commits have signed the CLA. 👍


此处折叠了52条消息 查看更多
27 天前 添加了label:approved
tanghaoran
27 天前 评论:
27 天前 评论:
/lgtm


27 天前 添加了label:lgtm
27 天前 解决了最后一个问题
27 天前 合入了pull request
描述
优化actions流水线配置
关联的Issue
NA
测试
文档更新
类型标签