已合并
update actions files,add post action #1389
Larry创建于 27 天前
update actions files,add post action #1389
已合并
Larry创建于 27 天前
已删除 :master合入到cann/pto-isamaster
Larry成员
27 天前

描述

优化actions流水线配置

关联的Issue

NA

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 Larry 的贡献)
LLarry成员
27 天前 创建了 pull request,commit 1c43b841
atomgit-bot
atomgit-bot
27 天前 评论:

变更摘要

此 PR 主要对 actions 流水线配置进行了系统性优化,包括:将编译/UT 脚本中的架构判断从 task_name 迁移到新的 ge_st_rt2 变量;将 shell 脚本的错误处理模式从 set +e 改为 set -e 并引入断言函数;将 .run 包的验证逻辑从 compile.sh 脚本中提取到工作流级别,复用外部 verify-package action;同时统一了工作流命名、运行环境配置及 checkout ref 的引用方式。

主要改动

  • 脚本错误处理加固compile.shut.shset +e 改为 set -e 配合 set -o pipefailcompile.sh 新增 DP_ASSERT_EQUAL 断言函数替代原有的手动 ret 检查和 exit 模式,使构建失败能立即终止并输出明确的对比信息。
  • 架构判断变量迁移:所有脚本和工作流中将架构/平台判断从 task_name(如 *A5*== "A3")改为统一的 ge_st_rt2 变量(值为 A3/A5),由调用方工作流 PR-pipeline_pto-isa.ymlwith 参数中传入,compile_action.ymlllt_action.yml 新增 ge_st_rt2 输入参数并导出为环境变量。
  • 编译产物处理重构compile.sh 删除了包重命名、安装验证、卸载验证及目录清理等约 60 行逻辑,改为在工作流 compile_action.yml 中新增 rename_packageverify_package 步骤(后者复用外部 cann/.gitcode/actions/verify-package@master action);A5 架构的编译任务跳过包验证和 OBS 上传。
  • 工作流配置规范化PR-pipeline_pto-isa.ymlrepo_namept-isa 修正为 pto-isa,runner 从 codearts-hosted 改为 dedicate-hosted 并指定容器镜像,所有 checkout 步骤的 ref 统一为 ${{ atomgit.event.pull_request.merge_commit_sha }};三个 action 工作流名称分别改为更具辨识度的 compile_actionUTStaticCheck
  • 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)。
likedislike
atomgit-bot
atomgit-bot
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} 未加引号、尾部多余 $、缺少 localset -eDP_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

💬 仅评论

likedislike
CANN-robotCANN-robot成员
27 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

likedislike
此处折叠了52条消息 查看更多
CANN-robotCANN-robot成员
27 天前 添加了label:approved
tanghaoran
tanghaoran成员
27 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
27 天前 添加了label:lgtm
CANN-robotCANN-robot成员
27 天前 解决了最后一个问题
CANN-robotCANN-robot成员
27 天前 合入了pull request