GitHub Actions upload-code-coverage 弃用非 Cobertura
Code coverage uploads now flag invalid report formats
CI/CD 流水线中依赖覆盖率上报的开发者必须立即检查并修改脚本,否则 workflow 会持续报错中断。请尽快将测试输出转换为 Cobertura XML 格式。
The GitHub Code Quality upload-code-coverage action now checks that your coverage report is in Cobertura XML format. If it isn’t in a supported format, the upload step fails and the Actions log shows this error:
GitHub Code Quality 的 upload-code-coverage 操作现在会检查您的覆盖率报告是否为 Cobertura XML 格式。如果报告不是受支持的格式,上传步骤将失败,并且 Actions 日志中会显示以下错误:
This file is not a Cobertura XML report. Upload a Cobertura XML report.
此文件不是 Cobertura XML 报告。请上传 Cobertura XML 报告。
Previously, these uploads appeared to succeed, but no coverage showed up on your pull requests. Now you’ll find out about the problem in the workflow run, with a clear next step.
以前,这些上传看似成功,但您的拉取请求上并未显示任何覆盖率数据。现在,您可以在工作流运行中发现该问题,并获得明确的下一步操作指引。
If your workflow begins failing with this error, configure your test framework to output Cobertura XML, or convert your report to Cobertura XML before the upload step.
如果您的工作流开始因出现此错误而失败,请配置测试框架以输出 Cobertura XML 格式,或在上传步骤之前将报告转换为 Cobertura XML 格式。
We’ve also made processing more forgiving for valid Cobertura reports. We no longer reject a report because of minor structural issues, and we skip individual lines that don’t have a usable line number or hit count instead of discarding the whole report.
我们还使处理过程对有效的 Cobertura 报告更加宽容。我们不再因轻微的结构问题而拒绝报告,并且会跳过那些没有可用行号或命中计数的单行,而不是丢弃整个报告。
To use code coverage, you need GitHub Code Quality enabled for your repository. This change is available now on GitHub Enterprise Cloud and GitHub Team, including GitHub Enterprise Cloud with data residency. It isn’t available on GitHub Enterprise Server. Learn more about setting up code coverage for your repository on GitHub Enterprise Cloud.
要使用代码覆盖率功能,您需要为仓库启用 GitHub Code Quality。此更改现已在 GitHub Enterprise Cloud 和 GitHub Team(包括具有数据驻留功能的 GitHub Enterprise Cloud)上可用。它在 GitHub Enterprise Server 上不可用。了解更多关于在 GitHub Enterprise Cloud 上为您的仓库设置代码覆盖率的信息。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力