name: Test C++ on: workflow_call: permissions: contents: read jobs: # The stand-in builds without the engine, so an SDK header reaching past `c/` fails here before the engine builds. test_cpp_stub: name: Test C++ on Ubuntu against the Stub Library runs-on: ubuntu-26.04 container: ghcr.io/ashvardanian/fatwheels:cpu@sha256:dea62ae1cefc270388aabe2301e55970f5408693df8bf59d3b9d88ed5e527f7e defaults: run: shell: bash timeout-minutes: 30 steps: - name: Checkout Repository uses: actions/checkout@v7 with: submodules: recursive - name: Compile Each Header Alone run: for header in cpp/usearch/*.hpp; do $CXX -std=c++23 -fsyntax-only -I c -I cpp -x c++ "$header"; done # No preset, as the development ones name Clang, so CMake takes the compiler from CXX like the header check. - name: Build the Stub Suite run: | cmake -B build_debug -G Ninja -D CMAKE_BUILD_TYPE=Debug -D USEARCH_BUILD_STUB=ON -D USEARCH_BUILD_TEST=ON cmake --build build_debug --target usearch_test_cpp_stub - name: Test the Stub Suite run: ctest --test-dir build_debug --tests-regex '^usearch_test_cpp_stub$' --no-tests=error --output-on-failure test_cpp_engine: name: Test C++ on Ubuntu against the Engine needs: test_cpp_stub runs-on: ubuntu-26.04 container: ghcr.io/ashvardanian/fatwheels:cpu@sha256:dea62ae1cefc270388aabe2301e55970f5408693df8bf59d3b9d88ed5e527f7e defaults: run: shell: bash timeout-minutes: 90 steps: - name: Checkout Repository uses: actions/checkout@v7 with: submodules: recursive # The whole tree builds, so the fixtures the engine suite requires, like a seeded checkpoint, build with it. - name: Build the Engine Suite run: | cmake -B build_debug -G Ninja -D CMAKE_BUILD_TYPE=Debug -D USEARCH_BUILD_LIBRARIES=ON -D USEARCH_BUILD_TEST=ON cmake --build build_debug - name: Test the Engine Suite run: ctest --test-dir build_debug --tests-regex '^usearch_test_cpp$' --no-tests=error --output-on-failure