[feat][ci]: reduce duplicate HC32 attachconfig builds#11474
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: workflowReviewers: Rbb666 kurisaW supperthomas Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-06-22 10:33 CST)
📝 Review Instructions
|
ac953cd to
99df3e0
Compare
|
有看过为啥那么长时间吗?解决时间长的问题,比较靠谱一些,还有分组只放一两个bsp会很浪费下好的环境,建议放一起。 |
|
https://github.com/RT-Thread/rt-thread/blob/master/bsp/hc32/ev_hc32f334_lqfp64/.ci/attachconfig/ci.attachconfig.yml 这个配置不应该每个bsp都测,只要一个bsp测过相关的driver即可。 |
| ] | ||
| }, | ||
| { | ||
| "RTT_BSP": "hc32_f4a0_f448", |
There was a problem hiding this comment.
这个统一放到一个分组里面,继续优化yml,会更快一些。
这一块跑的配置太多了,正如你下面所说的。我精简一下这一块的driver的编译吧 |
|
@supperthomas 现在采用的策略是加了一个可选的 |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
RT-Thread BSP Static Build Check 中
at32_hc32_ht32matrix leg 耗时明显偏长。参考 https://github.com/RT-Thread/rt-thread/actions/runs/27336610440/job/80762661792?pr=11469 ,该 job 总耗时约 33 分 30 秒,会拖长整个 CI workflow 的完成时间。重新分析后,耗时主要不是 matrix 分组本身,而是
tools/ci/bsp_buildings.py的构建流程:每个 BSP 默认编译完成后,还会继续执行该 BSP.ci/attachconfig/ci.attachconfig.yml中的每个附加配置。HC32 这里有多个 BSP 都配置了 attachconfig,且大量 driver/kconfig 组合重复,因此同类 driver 被重复构建多次,导致该 job 拖尾。同时,当前
bsp_buildings.yml的paths-ignore直接忽略了.github/**。这会导致修改.github/ALL_BSP_COMPILE.json或.github/workflows/bsp_buildings.yml时,BSP Static Build Check 本身不会被 pull request 自动触发,CI matrix 和 workflow 配置变更缺少自动验证。你的解决方案是什么 (what is your solution)
保留
at32_hc32_ht32统一 matrix 分组,避免拆成多个小 job 后重复下载环境、初始化工具链,并继续利用同一个 job 内已经准备好的构建环境。新增可选的
ATTACHCONFIG_RTT_BSPmatrix 字段,并传入tools/ci/bsp_buildings.py:ATTACHCONFIG_RTT_BSP的 matrix leg 保持原行为,继续对所有 BSP 执行 attachconfig。ATTACHCONFIG_RTT_BSP的 matrix leg 中,所有 BSP 仍执行默认编译,只有指定的代表 BSP 执行 attachconfig。at32_hc32_ht32中保留 HC32 代表 BSPhc32/ev_hc32f4a8_lqfp176、hc32/ev_hc32f334_lqfp64、hc32/ev_hc32f472_lqfp100执行 attachconfig,减少其它 HC32 BSP 重复跑同类 driver 组合。ht32/ht32f53252仍保留 attachconfig 构建,避免影响 HT32 原有覆盖。本 PR 不修改各 BSP 原有的
.ci/attachconfig/ci.attachconfig.yml内容,只在 CI 构建流程中选择代表 BSP 执行附加配置构建。其它 HC32 BSP 仍执行默认 build,但跳过重复 attachconfig。另外,将
bsp_buildings.yml中对.github/**的粗粒度忽略改为更细的文档/模板/标签/utest 配置忽略项。这样修改.github/ALL_BSP_COMPILE.json和.github/workflows/bsp_buildings.yml时,可以自动触发 BSP Static Build Check 来验证 CI 相关变更;.github/utest/**仍保持忽略,避免 utest 专用配置变更误触发 BSP 编译。请提供验证的bsp和config (provide the config and bsp)
BSP:
at32/at32m416-starthc32/ev_hc32f4a8_lqfp176hc32/ev_hc32f334_lqfp64hc32/ev_hc32f472_lqfp100ht32/ht32f53252.config:
action:
rtt/masterafter upstream.githubchanges..github/ALL_BSP_COMPILE.jsonpassedpython -m json.tool..github/workflows/bsp_buildings.ymlpassed YAML parsing.tools/ci/bsp_buildings.pypassedpy_compile..github/ALL_BSP_COMPILE.json,.github/workflows/bsp_buildings.yml, andtools/ci/bsp_buildings.py; BSP attachconfig files are unchanged..github/ALL_BSP_COMPILE.jsonand.github/workflows/bsp_buildings.ymlare no longer in this workflow's.githubignore list, while.github/utest/**remains ignored.]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up