跳到主内容
@wquguru
精选88VoxAI 产品与模型

用 Claude Code 和 Codex 优化 GitHub CI 流程

Claude Code and Codex can push dozens of PRs a day now. Writing the code takes m…

原文
发到 X
推荐理由

提供了可直接复用的结构化 Prompt,清晰展示了如何利用 AI 解决具体的工程痛点,逻辑严密且数据详实。

Claude Code and Codex can push dozens of PRs a day now. Writing the code takes minutes, and the rest of the time goes to waiting on CI, the checks and tests GitHub runs every time you push.

Claude Code 和 Codex 现在每天可以推送几十个 PR。编写代码只需几分钟,其余时间都花在等待 CI 上,也就是 GitHub 每次你推送时运行的检查和测试。

Nine changes took each PR's CI 𝗳𝗿𝗼𝗺 𝘂𝗽 𝘁𝗼 𝟰𝟬 𝗺𝗶𝗻𝘂𝘁𝗲𝘀 𝗱𝗼𝘄𝗻 𝘁𝗼 𝟮. One step was having an agent pull the last 150 CI runs and split every job into three parts: waiting for a machine, setup, and actually running. That alone showed that half the test jobs 𝘄𝗲𝗿𝗲𝗻'𝘁 𝘂𝘀𝗶𝗻𝗴 𝘁𝗵𝗲 𝗱𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝘆 𝗰𝗮𝗰𝗵𝗲 at all, a bug that had been sitting there for a whole year.

经过九项改动,每个 PR 的 CI 时间从长达 40 分钟缩短至 2 分钟。其中一步是让一个代理拉取最近 150 次 CI 运行记录,并将每个作业拆分为三个部分:等待机器、环境配置以及实际运行。仅此一项就显示出一半的测试作业根本没有使用依赖缓存,这是一个存在了一年的 bug。

Send this prompt to Claude Code or Codex to find out where your CI time goes, then cut it down one piece at a time 👇

将此提示词发送给 Claude Code 或 Codex,以找出你的 CI 时间花在哪里,然后逐一削减 👇

"Audit this repo's CI: 1. Use gh to pull the last 150 CI runs and split each job's time into three parts: waiting in the queue for a machine, setup (checkout, installing dependencies, restoring the cache), and actually running the task. List the 5 slowest jobs and how many seconds each part takes. 2. Check these 9 things one by one: queueing on the default runners; slow lint; slow typechecking; tests that aren't sharded, or machines that are too small; every test file reloading the whole app; slow setup (cache misses, clones that aren't blobless, more parallel tasks than cores); jobs that don't run in parallel; every PR running the full test suite; no local checks before push. 3. For each problem, tell me how many seconds it costs now, which line of which file to change, and roughly how much it would save. List the ones that cost more money (new runners, bigger machines) or run fewer tests separately for me to decide. Give me the report first. Don't change anything."

"审计此仓库的 CI: 1. 使用 gh 拉取最近 150 次 CI 运行记录,并将每个作业的时间拆分为三个部分:在队列中等待机器的时间、配置时间(检出代码、安装依赖、恢复缓存)以及实际运行任务的时间。列出最慢的 5 个作业以及每个部分耗时多少秒。 2. 逐一检查以下 9 项内容:默认运行器上的排队;缓慢的 lint;缓慢的类型检查;未分片的测试,或过小的机器;每个测试文件都重新加载整个应用;缓慢的配置(缓存未命中、非 blobless 的克隆、并行任务数超过核心数);未并行运行的作业;每个 PR 都运行完整的测试套件;推送前没有本地检查。 3. 对于每个问题,告诉我现在花费了多少秒,需要修改哪个文件的哪一行,以及大约能节省多少时间。将那些花费更多金钱(新运行器、更大的机器)或运行较少测试的项目单独列出,以便我做出决定。 先给我报告。不要做任何更改。"

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件