Skip to content

Speed up CI runs - #902

Merged
ntamas merged 5 commits into
igraph:mainfrom
szhorvat:ci/faster-ci
Nov 29, 2026
Merged

ntamas merged 5 commits into
igraph:mainfrom
szhorvat:ci/faster-ci

Conversation

@szhorvat

@szhorvat szhorvat commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Speed up CI runs. Point 2 is a fix, but do check the others please.

  1. Test the built wheels. Test dependencies are installed with CIBW_TEST_EXTRAS instead of pip install '.[test]'. The old command rebuilt igraph from source in every test environment and tested that build instead of the repaired wheel. This removes a 45 to 100 s rebuild for each CPython version on each platform, and the shipped wheels now actually get tested.
  2. Fix the C core cache keys. The macOS, Windows and sdist keys hashed .git/modules/**/HEAD. That glob includes the submodule reflog, which contains timestamps, so the cache never hit. The keys now hash only the submodule's HEAD, so the C core is no longer rebuilt on every run (about 2 to 2.5 min per job). It also stops saving a new cache entry on every run.
  3. Split the Linux x86_64 job. manylinux and musllinux now build in separate parallel jobs, as aarch64 already did.
  4. Split the WebAssembly job. Each Pyodide version now builds in its own job of a matrix instead of three builds one after the other.

The test command ran "pip install '.[test]'" from the project directory.
pip builds a local directory from source, so every test run uninstalled
the repaired wheel, compiled the extension again and tested that build
instead. The shipped wheels were never tested, and the rebuild took
45-100 s for each CPython version on each platform.

Install the test dependencies with CIBW_TEST_EXTRAS instead, and keep
preferring binary wheels for them with PIP_PREFER_BINARY.

Assisted-by: Claude Opus 5.5
The macOS, Windows and sdist cache keys hashed .git/modules/**/HEAD.
That glob also matches the submodule reflog logs/HEAD, which contains
checkout timestamps, so the key changed on every run: the C core was
rebuilt each time and a new cache entry was saved. Hash only the
submodule's HEAD file, as the sanitizer job already does.

Assisted-by: Claude Opus 5.5
The two cibuildwheel steps ran one after the other in one job, which made
it the slowest job in the workflow. Split it in two, as the aarch64 builds
already are.

Assisted-by: Claude Opus 5.5
The three Pyodide wheels each rebuild the C core with their own
Emscripten version and took about 6 minutes each, one after the other.
Build them in parallel with a matrix over the CPython versions.

Assisted-by: Claude Opus 5.5

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the CI build and wheel-testing changes.

No open issues 🎉

What changed in this PR

This PR aims to shorten igraph’s CI runs by parallelizing wheel builds and avoiding source rebuilds during wheel testing.

Changes:

  • Split Linux x86_64 builds into separate manylinux and musllinux jobs, and run WebAssembly builds in a Python-version matrix.
  • Install test dependencies through cibuildwheel extras, preserving the built wheel under test and preferring binary dependencies.
  • Narrow C-core cache hashing to the igraph submodule’s HEAD file.
File Description
.github/​workflows/​build.yml Parallelizes build jobs, updates artifact names, streamlines test dependency installation, and refines C-core cache keys.

Review effort: Balanced

@szhorvat
szhorvat requested a review from ntamas November 28, 2026 19:09
The sdist command copies the generated parser sources from vendor/build,
but the sdist job only cached vendor/install. This went unnoticed because
the cache key never matched before. Now that it does, a cache hit skipped
the C core build and sdist failed. Cache vendor/build as well, under a
new key, as the sanitizer job already does.

Assisted-by: Claude Opus 5.5
@ntamas
ntamas merged commit af5714c into igraph:main Nov 29, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants