ci: [refactor] Add .github/ci-windows.py build step
What changed, and why it matters
This commit is a pure CI (Continuous Integration) refactor for Windows builds. It moves the existing Windows build command from the GitHub Actions YAML file into a shared Python helper script, using a new Python 3.13 function to count CPU cores. There is no change to Bitcoin Core's actual code, no security fix, and no vulnerability introduced.
No security action required. This is a routine CI maintenance/refactor change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch refactors the Windows CI workflow. It adds a build() function to .github/ci-windows.py that runs cmake --build build -j <os.process_cpu_count()> --config Release, and updates .github/workflows/ci.yml to call this Python script instead of invoking cmake --build directly. The use of os.process_cpu_count() is explicitly noted as intentional because it requires Python 3.13, which is already the minimum required version on Windows for this project. The build behavior is functionally equivalent to the previous inline command (-j $NUMBER_OF_PROCESSORS).
Changed components
.github/ci-windows.py.github/workflows/ci.ymlInspect captured patch +17 / −3
diff --git a/.github/ci-windows.py b/.github/ci-windows.py
index 142fee7b..5d28ed0b 100755
--- a/.github/ci-windows.py
+++ b/.github/ci-windows.py
@@ -56,15 +56,30 @@ def generate(ci_type):
run(command)
+def build():
+ command = [
+ "cmake",
+ "--build",
+ "build",
+ "-j",
+ str(os.process_cpu_count()),
+ "--config",
+ "Release",
+ ]
+ run(command)
+
+
def main():
parser = argparse.ArgumentParser(description="Utility to run Windows CI steps.")
parser.add_argument("ci_type", choices=GENERATE_OPTIONS, help="CI type to run.")
- steps = ["generate"]
+ steps = ["generate", "build"]
parser.add_argument("step", choices=steps, help="CI step to perform.")
args = parser.parse_args()
if args.step == "generate":
generate(args.ci_type)
+ elif args.step == "build":
+ build()
if __name__ == "__main__":
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f293b06e..75590d1d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -280,9 +280,8 @@ jobs:
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
- name: Build
- working-directory: build
run: |
- cmake --build . -j $NUMBER_OF_PROCESSORS --config Release
+ py -3 .github/ci-windows.py ${{ matrix.job-type }} build
- name: Check executable manifests
if: matrix.job-type == 'standard'
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.