arXiv:2611.00667cs.SEOct 2026

Manuscript Offprint

arXiv:2611.00667

Characterizing and Predicting the Longest CI Builds in Machine Learning Projects

Yonghui Huang, Daniel Alencar da Costa, Mohamed Sami Rakha, Grant Dick

Abstract

Continuous integration (CI) builds in machine learning (ML) projects tend to run longer than in other projects, yet little is known about the longest builds, which consume most CI time. This paper characterizes the longest builds in ML projects, analyzes how CI workflow properties are associated with them, and evaluates whether they can be predicted before execution. We study 269,930 GitHub Actions builds from 107 open-source ML projects. The top 18% longest builds account for 80.30% of total build time and fail in 39.09% of cases. Build duration differs significantly across ML project types. The framework and infrastructure ML projects have the longest upper tail and produce 98% of the longest builds, whereas projects that use existing ML libraries have the lowest median build duration. The longest builds are most strongly associated with the recent history of the same workflow, as the duration of its last build and the median duration of the project's last 20 builds show large effect sizes. The longest builds are more consistently associated with CI workflow structure than with configuration. The number of jobs, control flow complexity, coupling complexity, and maximum steps per job show medium effect sizes, whereas caching, matrix settings, and Docker builds show small or negligible effects. Framework-specific workflows have the largest percentage of builds among long builds. Platform-specific workflows

*Corresponding author.

Email addresses: andie.huang@postgrad.otago.ac.nz (Yonghui (Andie) Huang), danielcalencar@otago.ac.nz (Daniel Alencar da Costa), grant.dick@otago.ac.nz (Grant Dick), rakha@zewailcity.edu.eg (Mohamed Sami Rakha) produce the largest number of the longest builds. Finally, 47 features describing the build, the recent builds of the same workflow, its workflow structure, and the ML usage depth and domain of the project outperform a traditional build-duration feature baseline with all four classifiers. When builds are evaluated in chronological order, the best model (XGBoost) reaches an F1-score of 0.775, compared with 0.682 for the baseline, and an AUC-ROC of 0.955. These results show that build history and CI workflow structure help identify the long-running builds in ML projects before they run.

Keywords: Continuous integration, Build duration, Machine learning projects, GitHub Actions, Workflow complexity, Mining software repositories

1. Introduction

Software products increasingly use machine learning (ML) in applications such as search ranking, recommendation systems, and fraud detection (Liu, 2009; Adomavicius and Tuzhilin, 2005; Ali et al., 2022). Once ML functionality is deployed, maintaining it becomes a recurring engineering task. Incoming data may change, the deployed model may become outdated as the business grows, and the surrounding software stack may evolve (Sculley et al., 2015; Amershi et al., 2019; Kreuzberger et al., 2023). Sculley et al. (2015) show that ML systems often depend on data formats, feature definitions, libraries, and runtime versions. As a result, retraining and redeployment are not only model updates but also require teams to keep data preparation, dependencies, and execution environments consistent. At the same time, continuous integration (CI) has become a standard way to keep traditional software in a releasable state (Shahin et al., 2017). Industrial Machine Learning Operations (MLOps) guidelines extend this idea and recommend that the ML project development process should adopt automated CI/CD pipelines in order to make the whole project delivery repeatable and observable (Kreuzberger et al., 2023).

From a software engineering perspective, ML projects are more complex because of data, model, and infrastructure dependencies and iterative workflows (Sculley et al., 2015; Amershi et al., 2019). In this paper, we use ML projects to refer to software projects whose repositories contain code for building, using, or supporting ML functionality. This definition covers projects that provide ML infrastructure and projects that apply ML to specific tasks. In both cases, the software depends not only on the source code but also on the data used by the project, the model training process, the execution environment, and the services connected to it (Sculley et al., 2015; Amershi et al., 2019). As a result, even a routine change to data, dependencies, or infrastructure can require teams to rebuild, test, and revise several parts of the project. These characteristics affect how teams design CI/CD pipelines and how they experience build and deployment activities in ML projects. Recent research has started to examine how ML projects use CI/CD in practice. For example, Rzig et al. (2022) characterize CI adoption in ML projects by studying which CI services they use more frequently and how often the developers modify CI configurations. Houerbi et al. (2024) analyze how CI/CD configurations change in ML projects, identify common change categories and 14 co-change patterns with machine learning related code, and report frequent changes to CI/CD rules together with recurring configuration problems, such as adding dependencies directly in CI workflow files and keeping outdated settings in the configuration. Shahin et al. (2017) identify long build and testing times and unreliable deployment pipelines as common challenges in adopting CI/CD. Taken together, these studies suggest that CI/CD workflows in ML projects are frequently revised as project dependencies, build steps, and configuration rules change. Such changes may affect how builds are executed and, in turn, may influence build duration in ML projects (Shahin et al., 2017; Rzig et al., 2022; Houerbi et al., 2024).

Among build-duration issues, the longest builds are particularly important because they can consume disproportionate CI resources and delay developer feedback. As a result, understanding which builds become the longest can help teams identify where CI time is concentrated and manage CI resources more effectively.

However, no prior work systematically characterizes these longest builds or predicts their occurrence in ML projects to support better resource management for CI execution. There is also emerging evidence that CI/CD pipelines in ML projects often have longer build durations than pipelines in non-ML projects (Bernardo et al., 2024). Bernardo et al. (2024) compared CI build durations in ML projects with matched non-ML projects and found that builds in ML projects tend to run longer, while medium-sized ML projects exhibit lower test coverage than non-ML projects. They also report that developers see build duration and build stability as specific obstacles when applying CI to ML projects (Bernardo et al., 2025). However, despite their practical importance, the longest builds in ML projects remain poorly understood. Prior work has not systematically examined which builds become the longest, what project and CI workflow characteristics are associated with them, or whether long duration builds can be predicted before execution. This gap limits our ability to understand where CI time is concentrated and how teams might anticipate costly CI runs. As a result, practitioners still lack empirical guidance on how to identify and anticipate the longest builds in ML projects so that CI resources can be allocated more effectively.

This lack of focused evidence is problematic for both research and practice. MLOps guidance recommends automated CI pipelines to help teams test changes, monitor model behavior, and retrain models when data or system conditions change (Kreuzberger et al., 2023). Such practices are important because ML service reliability depends not only on source code, but also on data and model behavior. When CI builds take a long time to finish, teams receive feedback later, which can slow experimentation, delay defect detection, and increase infrastructure cost (Shahin et al., 2017; Bernardo et al., 2025; Kreuzberger et al., 2023). This issue is especially relevant to ML projects, where CI builds may include work beyond compiling code and running tests. Build duration may also be affected by data handling steps, model training stages, and the configuration of specialized hardware (Amershi et al., 2019; Bernardo et al., 2024). A systematic investigation of the longest builds is therefore needed to identify which CI workflow and ML project characteristics are associated with long build duration, and to help teams anticipate builds that may consume large CI resources before they occur.

To address this gap, we conduct an empirical study of CI builds from 107 open-source ML projects that use GitHub Actions. In this paper, longest builds refers to the builds located in the upper tail of the build duration distribution among our studied dataset. Following the Pareto principle (Fenton and Bieman, 2014), we define them as the smallest top percentile of builds whose cumulative duration reaches 80% of the total build time. In our dataset, the longest builds are the top 18% of builds, i.e., builds that take at least 39.20 minutes. Section 3.1 describes how this threshold is derived. Specifically, we aim to characterize the longest builds in ML projects, examine how CI workflow properties (e.g., the organization of jobs, steps, and dependencies in CI workflows) and ML project attributes are associated with the occurrence of the longest builds, and evaluate whether these characteristics can be used to predict such builds before execution. We base our study on prior work comparing CI practices in ML and non-ML projects and examining CI/CD evolution in ML projects (Rzig et al., 2022; Bernardo et al., 2024; Houerbi et al., 2024). Our sample is drawn from the curated project lists used in these studies, which in turn originate from Gonzalez et al. (2020), and is further filtered to retain repositories with active GitHub Actions workflows and sufficient CI run history. Specifically, we investigate the following research questions:

  • RQ1: How can the longest builds in ML projects be characterized?

  • RQ2: How are CI workflow characteristics associated with the longest build durations in ML projects?

  • RQ3: Can the longest builds in ML projects be predicted accurately before execution?

Through statistical analysis on our dataset of 269,930 builds from 107 ML projects, we find that total build time is highly concentrated in a small fraction of builds. In particular, the top 18% longest builds account for about 80% of total build time and exhibit failure rates of about 39%.

We therefore focus on the top 18% longest builds, because they consume most of the CI time. We also find that the longest build durations are more consistently associated with how jobs depend on each other within a CI workflow than with execution environment factors, such as the operating system or CI runner configuration. Finally, we try to predict which builds will be among the top 18% longest builds before they run. Our features describe the recent builds and the structure of the CI workflow, perform better than the build features used in prior work (Ghaleb et al., 2019a) on predicting the top 18% longest builds. The best model reaches an F1 of 0.775 and an AUC-ROC of 0.955.

This work contributes to the literature on software engineering for ML and on MLOps in three ways:

  • We provide a systematic characterization of build duration in ML projects. We first analyze the distribution of build duration across the studied projects, and then focus on the top 18% longest builds. This analysis shows that these longest builds account for most of the total CI time and appear in most of the studied projects in our dataset. We also classify the projects by how they use ML and by their application area, and then analyze how build duration differs across these project categories.

  • We analyze how CI jobs are organized within CI workflows and identify CI workflow characteristics associated with the longest builds. The results show that the longest builds are more common when CI workflows contain more dependencies among jobs and longer chains of dependent jobs. In contrast, execution environment factors, such as the operating system and CI runner configuration, show weaker associations.

  • We propose 47 features to predict the longest builds in ML projects before they run. They describe the current build, recent builds of the same workflow, its job structure, and the project's ML usage depth and domain. These features outperform the build features used in prior work on predicting build duration in general software projects (Ghaleb et al., 2019a).

These contributions build on existing studies of CI in ML projects (Rzig et al., 2022; Bernardo et al., 2024; Houerbi et al., 2024; Bernardo et al., 2025). While prior work has examined CI usage, configuration changes, and differences between ML and non-ML projects, this paper focuses on build duration and on the small group of builds that consume most CI time. It also complements broader work on the maintenance challenges and development processes of ML projects (Sculley et al., 2015; Amershi et al., 2019) by showing how these challenges are reflected in CI build duration.

The remainder of this paper is organized as follows. Section 2 presents the study design, including project selection, data collection, and feature engineering. Section 3 presents the motivation, approach, and findings for each research question. Section 4 discusses the implications of our findings for developers and researchers. Section 5 outlines threats to validity, Section 6 positions this study against prior work on long CI builds, ML CI workflows, and CI cost reduction, and Section 7 concludes and suggests directions for future work.

References (65)