[ci] separate build and test jobs
Author: jameslambCreated Sep 27, 2026Updated Sep 29, 2026
Labelsmaintenance
Description
Most LightGBM CI jobs build the library and run its tests within the same environment. This leads to duplicated effort, unnecessary usage of CI resources, and most importantly an increased risk of missing user-facing issues.
These issues could be avoided by separating builds and tests in CI.
Opening this to track some work I'm planning to do splitting up LightGBM's CI.
Benefits of this work
- increased ability to catch user-facing issues (e.g. missing dependencies, problems with linking in the shared library)
- reduced usage of scarce CI resources (extra important for very-limited-capacity runners like macOS Intel)
- ... e.g. test jobs don't need to spend time installing build-only dependencies or compiling the library
- ... e.g. it enables using something like https://github.com/step-security/changed-files to do something like "skip R CI jobs on PRs that only touch Python code"
- reduce end-to-end CI time
- simpler CI code / configuration
- reduced effort to add more CI jobs (like the import-testing added in #7456)
- easier navigation in the GitHub UI (all jobs are bundled under 1 workflows, e.g. https://github.com/lightgbm-org/LightGBM/actions/runs/36292178494/job/108544251243?pr=7463)
Acceptance criteria
- LightGBM CI has jobs that just build artifacts and others that pull those into testing environments that resemble users' runtime environments
Approach
- introduce a PR workflow that calls all others via
workflow_call(https://github.com/lightgbm-org/LightGBM/pull/7463) - split all existing jobs into building and testing
- C++ (
lib_lightgbm.{dll,dylib,so}) - Python (sdist + wheels)
- R (CRAN-style sdist)
- SWIG (
.jar) - CLI (
lightgbm.exe)
- C++ (
- move NuGet build into its own workflow
Notes
We have been using a split like this in the RAPIDS projects for a while (example: https://github.com/NVIDIA/cuml/blob/main/.github/workflows/pr.yaml) and I've found it to be a pretty powerful way to simplify things and to make CI a more useful approximation of users' runtime environments.
Source: lightgbm-org/LightGBM