Skip to content

[C API] Add GitHub Actions workflow for building and testing C API bindings#350

Open
rfsaliev wants to merge 5 commits into
dev/c-apifrom
rfsaliev/c-api-ci
Open

[C API] Add GitHub Actions workflow for building and testing C API bindings#350
rfsaliev wants to merge 5 commits into
dev/c-apifrom
rfsaliev/c-api-ci

Conversation

@rfsaliev

@rfsaliev rfsaliev commented Jul 13, 2026

Copy link
Copy Markdown
Member

This pull request introduces a new GitHub Actions workflow to automate building and testing of the C API bindings, and makes several improvements to the C API test infrastructure and code quality. The changes also include minor template parameter renaming for consistency and safety checks in tests.

CI/CD Improvements:

  • Added a new workflow .github/workflows/build-c-api-bindings.yml to automatically build and test C API bindings across multiple compilers and configurations on push, PR, and manual triggers.

Test Infrastructure Enhancements:

  • Enabled CTest integration in bindings/c/CMakeLists.txt by including CTest and calling enable_testing() when C API tests are built.

Code Quality and Consistency:

  • Renamed template parameters from Allocator to Alloc in DispatchConverter specializations within leanvec.hpp, lvq.hpp, simple.hpp, and sq.hpp for naming consistency and clarity. [1] [2] [3] [4]

Test Robustness:

  • Added null pointer checks before running run_build_and_search in bindings/c/tests/c_api_index.cpp to prevent potential crashes if storage creation fails.

…nverter specializations

In namespace svs, partial specializations of lib::DispatchConverter with a
template parameter named 'Allocator' caused clang-15 (and clang-16) to
incorrectly resolve the name to the class template svs::lib::Allocator,
resulting in 'use of class template requires template arguments' errors.

Rename the template parameter from 'Allocator' to 'Alloc' in:
- bindings/c/src/data_builder/simple.hpp
- bindings/c/src/data_builder/sq.hpp
- bindings/c/src/data_builder/lvq.hpp
- bindings/c/src/data_builder/leanvec.hpp
@rfsaliev rfsaliev marked this pull request as ready for review July 13, 2026 16:19
@mergify

mergify Bot commented Jul 13, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@rfsaliev

Copy link
Copy Markdown
Member Author

@ethanglaser, can you please review .github/workflows/build-c-api-bindings.yml and provide your comments/suggestions? What should be done else to make the new workflow following SVS CI rules?
Thank you.

@ethanglaser

Copy link
Copy Markdown
Member

Overall looks good to me. A couple questions:

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