143 lines
4.2 KiB
YAML
143 lines
4.2 KiB
YAML
name: Nightly CMake Subproject Integration
|
|
|
|
on:
|
|
schedule:
|
|
# Run after the other nightly jobs to avoid starting every heavy job at once.
|
|
- cron: '30 16 * * *'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
subproject-integration:
|
|
name: Subproject Build & Example (${{ matrix.mode }})
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 90
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- mode: linux-x64
|
|
cache_key: full
|
|
enable_zvec_core: false
|
|
- mode: linux-x64-enable-zvec-core
|
|
cache_key: core-only
|
|
enable_zvec_core: true
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Setup ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
with:
|
|
key: cmake-subproject-linux-x64-${{ matrix.cache_key }}
|
|
max-size: 150M
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.10'
|
|
cache: 'pip'
|
|
cache-dependency-path: 'pyproject.toml'
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends \
|
|
libaio-dev
|
|
shell: bash
|
|
|
|
- name: Set up environment variables
|
|
run: |
|
|
NPROC=$(nproc 2>/dev/null || echo 2)
|
|
echo "NPROC=$NPROC" >> "$GITHUB_ENV"
|
|
echo "$(python -c 'import site; print(site.USER_BASE)')/bin" >> "$GITHUB_PATH"
|
|
shell: bash
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install \
|
|
cmake==3.30.0 \
|
|
ninja==1.11.1
|
|
shell: bash
|
|
|
|
- name: Configure subproject integration
|
|
run: |
|
|
SMOKE_SOURCE="$RUNNER_TEMP/zvec-subproject-nightly-${{ matrix.cache_key }}"
|
|
SMOKE_BUILD="$RUNNER_TEMP/zvec-subproject-nightly-build-${{ matrix.cache_key }}"
|
|
|
|
mkdir -p "$SMOKE_SOURCE" "$SMOKE_BUILD"
|
|
cp "$GITHUB_WORKSPACE/.github/cmake/subproject-integration/CMakeLists.txt" \
|
|
"$SMOKE_SOURCE/CMakeLists.txt"
|
|
|
|
CMAKE_ARGS=(
|
|
-DZVEC_SOURCE_DIR="$GITHUB_WORKSPACE"
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
-DENABLE_WERROR=ON
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
)
|
|
|
|
if [[ "${{ matrix.enable_zvec_core }}" == "true" ]]; then
|
|
CMAKE_ARGS+=(-DENABLE_ZVEC_CORE=ON)
|
|
else
|
|
CMAKE_ARGS+=(
|
|
-DBUILD_TOOLS=OFF
|
|
-DBUILD_C_BINDINGS=OFF
|
|
-DBUILD_PYTHON_BINDINGS=OFF
|
|
)
|
|
fi
|
|
|
|
cmake -S "$SMOKE_SOURCE" -B "$SMOKE_BUILD" -G Ninja \
|
|
"${CMAKE_ARGS[@]}"
|
|
|
|
echo "SMOKE_BUILD=$SMOKE_BUILD" >> "$GITHUB_ENV"
|
|
shell: bash
|
|
|
|
- name: Build subproject targets
|
|
if: ${{ ! matrix.enable_zvec_core }}
|
|
run: |
|
|
cmake --build "$SMOKE_BUILD" --target \
|
|
core_knn_diskann \
|
|
zvec_embed_db_example \
|
|
zvec_embed_core_example \
|
|
zvec_embed_ailego_example \
|
|
--parallel "$NPROC"
|
|
shell: bash
|
|
|
|
- name: Run subproject examples
|
|
if: ${{ ! matrix.enable_zvec_core }}
|
|
run: |
|
|
cd "$SMOKE_BUILD"
|
|
./bin/zvec_embed_db_example
|
|
./bin/zvec_embed_core_example
|
|
./bin/zvec_embed_ailego_example
|
|
shell: bash
|
|
|
|
- name: Build enable_zvec_core targets
|
|
if: ${{ matrix.enable_zvec_core }}
|
|
run: |
|
|
cmake --build "$SMOKE_BUILD" --target \
|
|
zvec_core_shared \
|
|
zvec_embed_core_only_example \
|
|
--parallel "$NPROC"
|
|
shell: bash
|
|
|
|
- name: Run enable_zvec_core example
|
|
if: ${{ matrix.enable_zvec_core }}
|
|
run: |
|
|
cd "$SMOKE_BUILD"
|
|
./bin/zvec_embed_core_only_example
|
|
ldd ./bin/zvec_embed_core_only_example | tee zvec-core-only-ldd.txt
|
|
grep -q 'libzvec_core\.so' zvec-core-only-ldd.txt
|
|
if grep -q 'libzvec\.so' zvec-core-only-ldd.txt; then
|
|
echo "core-only example unexpectedly depends on libzvec.so"
|
|
exit 1
|
|
fi
|
|
shell: bash
|