一句话:首个针对 GitHub Actions 工作流资源使用与优化机会的大规模实证研究,量化 CI/CD 成本并给出平台级优化建议。
CI/CD 已成为软件开发常态,GitHub Actions 因每月为公开仓库提供 2000 分钟免费算力而广受欢迎,但其资源究竟消耗在何处、是否可更高效,尚缺乏系统认识。本文开展首个针对 GitHub Actions 工作流的资源使用与优化机会的综合实证研究。结果显示 CI/CD 成本可观,付费层仓库平均每年约 504 美元;91.2% 的资源用于测试与构建,主要由 pull request(50.7%)、push(30.9%)与定时工作流(15.5%)触发。缓存等已有优化(付费层仓库采用率 32.9%)确有正面效果,但整体利用率偏低,说明需要更好的文档与工具引导开发者编写资源高效的工作流。作者进一步表明,平台层面较简单的改动,例如在仓库不活跃时停用定时工作流,可在受影响工作流上带来 1.1% 至 31.6% 的执行时间削减。
Continuous integration and continuous delivery (CI/CD) has become a prevalent practice in software development. GitHub Actions is emerging as a popular platform for implementing CI/CD pipelines, called workflows, especially because the platform offers 2,000 minutes of computation for free to public repositories each month. To understand what these resources are used for and whether CI/CD could be more efficient, this paper presents the first comprehensive empirical study of resource usage and optimization opportunities of GitHub Action workflows. Our findings show that CI/CD imposes significant costs, e.g., $504 per year for an average paid-tier repository. The majority of the used resources is consumed by testing and building (91.2%), which is triggered by pull requests (50.7%), pushes (30.9%), and regularly scheduled workflows (15.5%). While existing optimizations, such as caching (adopted by 32.9% of paid-tier repositories), demonstrate a positive impact, they overall remain underutilized. This result underscores the need for enhanced documentation and tools to guide developers toward more resource-efficient workflows. Moreover, we show that relatively simple changes in the platform, such as deactivating scheduled workflows when repositories are inactive, could result in reductions of execution time between 1.1% and 31.6% over the impacted workflows. Overall, we envision our findings to help improve the resource efficiency of CI/CD pipelines.
DOI 原文 ·
@inproceedings{paperbot11369,
title = {Resource Usage and Optimization Opportunities in Workflows of GitHub Actions},
author = {Islem Bouzenia and Michael Pradel},
booktitle = {ICSE},
year = {2024},
doi = {10.1145/3597503.3623303}
}