Initial commit
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
name: Bug Report
|
||||
description: Report a bug or unexpected behavior (e.g., crash, incorrect vector query, memory leak)
|
||||
title: "[Bug]: "
|
||||
labels: ["bug", "triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for reporting! Please provide detailed info so we can reproduce and fix it quickly.
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: What happened? What did you expect?
|
||||
placeholder: |
|
||||
e.g. "Query with vector field crashes when using Zvec Python API"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: steps_to_reproduce
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: Exact steps to trigger the issue (code snippets welcome)
|
||||
placeholder: |
|
||||
1. Build Zvec with CMake (Debug/Release)
|
||||
2. Run Python script: `python test.py`
|
||||
3. Call `collection.query(VectorQuery())`
|
||||
4. Process segfaults / hangs / returns wrong results
|
||||
render: python
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: logs_or_trace
|
||||
attributes:
|
||||
label: Logs / Stack Trace
|
||||
description: Paste relevant logs, LLDB/GDB backtrace, or CI failures
|
||||
placeholder: |
|
||||
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
|
||||
0x0000000104a2c3f0 in std::__1::shared_ptr<...>::...
|
||||
render: shell
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: input
|
||||
id: os
|
||||
attributes:
|
||||
label: Operating System
|
||||
placeholder: macOS 14 (M1), Ubuntu 22.04, Windows 11 (WSL2)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: build_env
|
||||
attributes:
|
||||
label: Build & Runtime Environment
|
||||
description: Compiler, CMake, Python, key dependencies
|
||||
placeholder: |
|
||||
clang 15.0.0, CMake 4.1.2, Python 3.11.9, magic_enum v0.9.7 (via git submodule)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
id: additional_context
|
||||
attributes:
|
||||
label: Additional Context
|
||||
options:
|
||||
- label: I've checked `git status` — no uncommitted submodule changes
|
||||
- label: I built with `CMAKE_BUILD_TYPE=Debug`
|
||||
- label: This occurs with or without `COVERAGE=ON`
|
||||
- label: The issue involves Python ↔ C++ integration (pybind11)
|
||||
@@ -0,0 +1,9 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Documentation
|
||||
url: https://github.com/your-org/zvec#readme
|
||||
about: Check the README, build guide, and API docs first.
|
||||
|
||||
- name: Python API Examples
|
||||
url: https://github.com/your-org/zvec/tree/main/examples
|
||||
about: See working usage examples.
|
||||
@@ -0,0 +1,55 @@
|
||||
name: Feature Request
|
||||
description: Suggest a new feature or improvement (e.g., better memory control, new query option)
|
||||
title: "[Feature]: "
|
||||
labels: ["enhancement"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for your idea! Help us understand the motivation and scope.
|
||||
|
||||
- type: textarea
|
||||
id: problem_or_motivation
|
||||
attributes:
|
||||
label: Problem / Motivation
|
||||
description: What problem does this solve? Why is it needed?
|
||||
placeholder: |
|
||||
e.g. "Current vector queries don't allow filtering by metadata + distance threshold at once"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: proposed_solution
|
||||
attributes:
|
||||
label: Proposed Solution
|
||||
description: How should it work? API sketch or pseudocode welcome.
|
||||
placeholder: |
|
||||
Add `filter=` and `max_distance=` args to `Zvec.query()`:
|
||||
```python
|
||||
results = db.query(vector, filter="category == 'A'", max_distance=0.5)
|
||||
```
|
||||
render: python
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: Alternatives Considered
|
||||
description: Are there workarounds? Why not use them?
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: dropdown
|
||||
id: impact_area
|
||||
attributes:
|
||||
label: Affected Area
|
||||
multiple: true
|
||||
options:
|
||||
- label: C++ Core (storage, indexing)
|
||||
- label: Python API / Bindings
|
||||
- label: Build System (CMake, Homebrew pkg)
|
||||
- label: Testing / CI / Coverage
|
||||
- label: Documentation
|
||||
validations:
|
||||
required: false
|
||||
@@ -0,0 +1,32 @@
|
||||
codecov:
|
||||
require_ci_to_pass: true
|
||||
|
||||
coverage:
|
||||
precision: 2
|
||||
round: down
|
||||
range: "60...75"
|
||||
|
||||
status:
|
||||
project:
|
||||
default: false
|
||||
patch:
|
||||
default: false
|
||||
|
||||
|
||||
parsers:
|
||||
gcov:
|
||||
branch_detection:
|
||||
conditional: true
|
||||
loop: true
|
||||
method: false
|
||||
macro: false
|
||||
|
||||
comment:
|
||||
require_changes: false
|
||||
layout: "reach,diff,flags,tree"
|
||||
behavior: default
|
||||
|
||||
|
||||
ignore:
|
||||
- "thirdparty/"
|
||||
- "tests/"
|
||||
@@ -0,0 +1,57 @@
|
||||
name: Build Wheels
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build_wheels:
|
||||
name: Build wheels on self-hosted manylinux_2_28
|
||||
runs-on: linux_x64
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set up Python (for cibuildwheel controller)
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install cibuildwheel
|
||||
run: |
|
||||
pip install --upgrade pip
|
||||
pip install cibuildwheel==2.17.0
|
||||
|
||||
- name: Build wheels using cibuildwheel
|
||||
run: |
|
||||
python -m cibuildwheel --output-dir wheelhouse
|
||||
# Save list of built wheels for publishing
|
||||
ls wheelhouse/*.whl | tee $GITHUB_STEP_SUMMARY
|
||||
echo "wheels=$(ls wheelhouse/*.whl | tr '\n' ' ')" >> $GITHUB_ENV
|
||||
|
||||
- name: Publish to TestPyPI
|
||||
if: success() && github.event_name == 'workflow_dispatch'
|
||||
env:
|
||||
TWINE_USERNAME: __token__
|
||||
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
||||
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
|
||||
run: |
|
||||
pip install twine
|
||||
twine upload --skip-existing --verbose wheelhouse/*.whl
|
||||
|
||||
- name: (Optional) Install and test from TestPyPI
|
||||
if: success() && github.event_name == 'workflow_dispatch'
|
||||
run: |
|
||||
# Create a clean venv
|
||||
python -m venv test_env
|
||||
source test_env/bin/activate
|
||||
pip install --upgrade pip
|
||||
# Install from TestPyPI (must allow pre-releases if version has dev/alpha)
|
||||
pip install --index-url https://test.pypi.org/simple/ \
|
||||
--extra-index-url https://pypi.org/simple/ \
|
||||
zvec
|
||||
# Run a simple smoke test
|
||||
python -c "import zvec; print('Import OK:', zvec.__version__)"
|
||||
shell: bash
|
||||
@@ -0,0 +1,83 @@
|
||||
# =============================================================================
|
||||
# Dockerfile.linux_x64_glibc228
|
||||
# Purpose: Ubuntu 18.10 gcc-9 + glibc 2.28 + CMake 3.30.0 + PyBind11 build environment
|
||||
# Warning: ubuntu:18.10 is EOL; use only for glibc 2.28 compatibility testing.
|
||||
# =============================================================================
|
||||
|
||||
# Use official Ubuntu 18.10 (Cosmic Cuttlefish)
|
||||
# glibc version: 2.28 (confirmed via `ldd --version`)
|
||||
FROM ubuntu:18.10
|
||||
|
||||
# Replace Ubuntu mirror with old-releases.ubuntu.com for older glibc compatibility
|
||||
RUN sed -i 's|http://\(.*\)/ubuntu|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list && \
|
||||
sed -i 's|http://security.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list
|
||||
|
||||
# Add Ubuntu 20.04 (focal) repo for GCC 9 ONLY
|
||||
RUN echo "deb http://archive.ubuntu.com/ubuntu/ focal main universe" >> /etc/apt/sources.list && \
|
||||
echo "deb http://security.ubuntu.com/ubuntu/ focal-security main universe" >> /etc/apt/sources.list
|
||||
|
||||
# Prevent interactive prompts & set non-root user
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
TZ=Etc/UTC
|
||||
|
||||
# Create non-root user for safety (optional but recommended)
|
||||
RUN useradd -m -u 1000 builder && \
|
||||
mkdir -p /workspace && chown builder:builder /workspace
|
||||
|
||||
# Install base system dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
gcc-9 g++-9 \
|
||||
ninja-build git curl ca-certificates vim wget lcov gnupg clang-format-18\
|
||||
rsync lsb-release \
|
||||
uuid-dev zlib1g-dev libssl-dev libffi-dev \
|
||||
pybind11-dev && \
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 \
|
||||
--slave /usr/bin/g++ g++ /usr/bin/g++-9 && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Miniforge (Conda) as root, then assign to builder
|
||||
ENV MINIFORGE_VERSION="latest"
|
||||
ENV MINIFORGE_HOME="/opt/miniforge3"
|
||||
|
||||
RUN curl -sSL "https://github.com/conda-forge/miniforge/releases/${MINIFORGE_VERSION}/download/Miniforge3-Linux-x86_64.sh" -o miniforge.sh && \
|
||||
bash miniforge.sh -b -p ${MINIFORGE_HOME} && \
|
||||
rm miniforge.sh && \
|
||||
chown -R builder:builder ${MINIFORGE_HOME}
|
||||
|
||||
# Switch to non-root user
|
||||
USER builder
|
||||
ENV PATH="${MINIFORGE_HOME}/bin:${PATH}"
|
||||
WORKDIR /workspace
|
||||
|
||||
# Create conda envs for supported Python versions
|
||||
RUN conda create -n py310 python=3.10 -y && \
|
||||
conda create -n py311 python=3.11 -y && \
|
||||
conda create -n py312 python=3.12 -y
|
||||
RUN conda clean --all -f -y
|
||||
|
||||
# Install CMake 3.30.0 from Kitware official binary
|
||||
# Ref: https://github.com/Kitware/CMake/releases/tag/v3.30.0
|
||||
RUN mkdir -p /tmp/cmake && cd /tmp/cmake && \
|
||||
curl -sSL -o cmake.tar.gz \
|
||||
"https://github.com/Kitware/CMake/releases/download/v3.30.0/cmake-3.30.0-linux-x86_64.tar.gz" && \
|
||||
tar -xzf cmake.tar.gz --strip-components=1 -C /tmp/cmake && \
|
||||
mkdir -p /home/builder/.local && \
|
||||
mv * /home/builder/.local/ && \
|
||||
chown -R builder:builder /home/builder/.local && \
|
||||
rm -rf /tmp/cmake
|
||||
|
||||
# Add CMake to PATH
|
||||
ENV PATH="/home/builder/.local/bin:${PATH}"
|
||||
|
||||
# Verify installations
|
||||
RUN cmake --version && \
|
||||
conda info && \
|
||||
conda env list && \
|
||||
python --version && \
|
||||
gcc --version && \
|
||||
ldd --version | head -n1
|
||||
|
||||
# Final setup
|
||||
WORKDIR /workspace
|
||||
@@ -0,0 +1,124 @@
|
||||
name: Zvec LinuxX64 CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: linux_x64
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10']
|
||||
fail-fast: false
|
||||
|
||||
container:
|
||||
image: zvec-registry.cn-hongkong.cr.aliyuncs.com/zvec/zvec:0.0.2
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- name: Activate Conda environment
|
||||
run: |
|
||||
# Map version to env name
|
||||
if [[ "${{ matrix.python-version }}" == "3.10" ]]; then
|
||||
ENV_NAME="py310"
|
||||
elif [[ "${{ matrix.python-version }}" == "3.11" ]]; then
|
||||
ENV_NAME="py311"
|
||||
elif [[ "${{ matrix.python-version }}" == "3.12" ]]; then
|
||||
ENV_NAME="py312"
|
||||
else
|
||||
echo "Unsupported Python version"
|
||||
exit 1
|
||||
fi
|
||||
echo "CONDA_ENV_NAME=$ENV_NAME" >> $GITHUB_ENV
|
||||
source /opt/miniforge3/bin/activate $ENV_NAME
|
||||
|
||||
pip install --upgrade pip pytest pytest-cov ruff
|
||||
|
||||
python --version
|
||||
shell: bash
|
||||
|
||||
- name: Prepare clean build directory
|
||||
run: |
|
||||
export CLEAN_WORKSPACE="/tmp/zvec"
|
||||
mkdir -p "$CLEAN_WORKSPACE"
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
|
||||
git config --global --add safe.directory "$CLEAN_WORKSPACE"
|
||||
git clone --recursive "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" .
|
||||
|
||||
if [ -n "${{ github.event.pull_request.head.sha }}" ]; then
|
||||
git checkout "${{ github.event.pull_request.head.sha }}"
|
||||
else
|
||||
git checkout "${{ github.sha }}"
|
||||
fi
|
||||
|
||||
echo "CLEAN_WORKSPACE=$CLEAN_WORKSPACE" >> $GITHUB_ENV
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
|
||||
- name: Run Ruff Linter
|
||||
run: |
|
||||
source /opt/miniforge3/bin/activate ${{ env.CONDA_ENV_NAME }}
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
ruff check .
|
||||
shell: bash
|
||||
|
||||
- name: Run Ruff Formatter Check (ensure code is formatted)
|
||||
run: |
|
||||
source /opt/miniforge3/bin/activate ${{ env.CONDA_ENV_NAME }}
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
ruff format --check .
|
||||
shell: bash
|
||||
|
||||
- name: Run clang-format Check
|
||||
run: |
|
||||
source /opt/miniforge3/bin/activate ${{ env.CONDA_ENV_NAME }}
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
|
||||
CPP_FILES=$(find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.hpp" -o -name "*.cc" -o -name "*.cxx" \) \
|
||||
! -path "./build/*" \
|
||||
! -path "./tests/*" \
|
||||
! -path "./scripts/*" \
|
||||
! -path "./python/*" \
|
||||
! -path "./thirdparty/*" \
|
||||
! -path "./.git/*")
|
||||
|
||||
if [ -z "$CPP_FILES" ]; then
|
||||
echo "No C++ files found to check."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
clang-format-18 --dry-run --Werror $CPP_FILES
|
||||
shell: bash
|
||||
|
||||
- name: Install Python dependencies and build package
|
||||
run: |
|
||||
source /opt/miniforge3/bin/activate ${{ env.CONDA_ENV_NAME }}
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
|
||||
NPROC=$(nproc 2>/dev/null || echo $(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 2))
|
||||
echo "ParallelGroup: Using $NPROC parallel jobs for build"
|
||||
|
||||
CMAKE_GENERATOR="Unix Makefiles" \
|
||||
CMAKE_BUILD_PARALLEL_LEVEL="$NPROC" \
|
||||
pip install -v .
|
||||
shell: bash
|
||||
|
||||
- name: Run Python Tests with Coverage
|
||||
run: |
|
||||
source /opt/miniforge3/bin/activate ${{ env.CONDA_ENV_NAME }}
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
python -m pytest python/tests/ --cov=zvec --cov-report=xml --no-cov-on-fail
|
||||
shell: bash
|
||||
|
||||
- name: Run Cpp Tests with Coverage
|
||||
run: |
|
||||
cd "$CLEAN_WORKSPACE/build"
|
||||
make unittest -j$(nproc)
|
||||
shell: bash
|
||||
@@ -0,0 +1,85 @@
|
||||
name: Zvec MacArm64 CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: mac_m1_arm
|
||||
|
||||
steps:
|
||||
- name: Run Ruff Linter
|
||||
run: |
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
ruff check .
|
||||
shell: bash
|
||||
|
||||
- name: Run Ruff Formatter Check (ensure code is formatted)
|
||||
run: |
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
ruff format --check .
|
||||
shell: bash
|
||||
|
||||
- name: Run clang-format Check
|
||||
run: |
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
|
||||
CPP_FILES=$(find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.hpp" -o -name "*.cc" -o -name "*.cxx" \) \
|
||||
! -path "./build/*" \
|
||||
! -path "./tests/*" \
|
||||
! -path "./scripts/*" \
|
||||
! -path "./python/*" \
|
||||
! -path "./thirdparty/*" \
|
||||
! -path "./.git/*")
|
||||
|
||||
if [ -z "$CPP_FILES" ]; then
|
||||
echo "No C++ files found to check."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
clang-format --dry-run --Werror $CPP_FILES
|
||||
shell: bash
|
||||
|
||||
- name: Prepare clean build directory
|
||||
run: |
|
||||
export CLEAN_WORKSPACE="/tmp/zvec"
|
||||
rm -rf "$CLEAN_WORKSPACE"
|
||||
mkdir -p "$CLEAN_WORKSPACE"
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
|
||||
git config --global --add safe.directory "$CLEAN_WORKSPACE"
|
||||
git clone --recursive "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" .
|
||||
|
||||
if [ -n "${{ github.event.pull_request.head.sha }}" ]; then
|
||||
git checkout "${{ github.event.pull_request.head.sha }}"
|
||||
else
|
||||
git checkout "${{ github.sha }}"
|
||||
fi
|
||||
|
||||
echo "CLEAN_WORKSPACE=$CLEAN_WORKSPACE" >> $GITHUB_ENV
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
|
||||
- name: Install Python dependencies and build package
|
||||
run: |
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
pip install --upgrade pip pytest pytest-cov ruff
|
||||
pip install -v .
|
||||
shell: bash
|
||||
|
||||
- name: Run Python Tests with Coverage
|
||||
run: |
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
python -m pytest python/tests/ --cov=zvec --cov-report=xml --no-cov-on-fail
|
||||
shell: bash
|
||||
|
||||
- name: Run Cpp Tests with Coverage
|
||||
run: |
|
||||
cd "$CLEAN_WORKSPACE/build"
|
||||
make unittest -j 16
|
||||
shell: bash
|
||||
@@ -0,0 +1,95 @@
|
||||
name: Nightly Coverage Report
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Runs daily at 00:00 CST (China Standard Time) = 16:00 UTC
|
||||
- cron: '0 16 * * *'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
coverage:
|
||||
runs-on: linux_x64
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10']
|
||||
fail-fast: false
|
||||
|
||||
container:
|
||||
image: zvec-registry.cn-hongkong.cr.aliyuncs.com/zvec/zvec:0.0.2
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- name: Activate Conda environment
|
||||
run: |
|
||||
if [[ "${{ matrix.python-version }}" == "3.10" ]]; then
|
||||
ENV_NAME="py310"
|
||||
elif [[ "${{ matrix.python-version }}" == "3.11" ]]; then
|
||||
ENV_NAME="py311"
|
||||
elif [[ "${{ matrix.python-version }}" == "3.12" ]]; then
|
||||
ENV_NAME="py312"
|
||||
else
|
||||
echo "Unsupported Python version"
|
||||
exit 1
|
||||
fi
|
||||
echo "CONDA_ENV_NAME=$ENV_NAME" >> $GITHUB_ENV
|
||||
source /opt/miniforge3/bin/activate "$ENV_NAME"
|
||||
python --version
|
||||
shell: bash
|
||||
|
||||
- name: Prepare clean build directory
|
||||
run: |
|
||||
export CLEAN_WORKSPACE="/tmp/zvec"
|
||||
mkdir -p "$CLEAN_WORKSPACE"
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
|
||||
git config --global --add safe.directory "$CLEAN_WORKSPACE"
|
||||
git clone --recursive "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" .
|
||||
|
||||
git checkout main # Always use main for nightly
|
||||
|
||||
echo "CLEAN_WORKSPACE=$CLEAN_WORKSPACE" >> $GITHUB_ENV
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
|
||||
- name: Build with COVERAGE config
|
||||
run: |
|
||||
source /opt/miniforge3/bin/activate "${{ env.CONDA_ENV_NAME }}"
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
pip install --upgrade pip pytest pytest-cov
|
||||
|
||||
NPROC=$(nproc 2>/dev/null || echo 2)
|
||||
echo "Using $NPROC parallel jobs"
|
||||
|
||||
CMAKE_GENERATOR="Unix Makefiles" \
|
||||
CMAKE_BUILD_PARALLEL_LEVEL="$NPROC" \
|
||||
pip install -v . \
|
||||
--config-settings="cmake.build-type=COVERAGE"
|
||||
shell: bash
|
||||
|
||||
- name: Run Python Tests with Coverage
|
||||
run: |
|
||||
source /opt/miniforge3/bin/activate "${{ env.CONDA_ENV_NAME }}"
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
python -m pytest python/tests/ --cov=zvec --cov-report=xml
|
||||
shell: bash
|
||||
|
||||
- name: Run C++ Tests and Generate Coverage
|
||||
run: |
|
||||
cd "$CLEAN_WORKSPACE/build"
|
||||
make unittest -j$(nproc) # Run all (nightly can afford it)
|
||||
cd "$CLEAN_WORKSPACE"
|
||||
# Ensure gcov.sh is executable
|
||||
chmod +x scripts/gcov.sh
|
||||
bash scripts/gcov.sh -k
|
||||
shell: bash
|
||||
|
||||
- name: Upload Coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
files: ${{ env.CLEAN_WORKSPACE }}/proxima-zvec-filtered.lcov.info,${{ env.CLEAN_WORKSPACE }}/coverage.xml
|
||||
flags: python,cpp,nightly
|
||||
name: nightly-linux-py${{ matrix.python-version }}
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
Reference in New Issue
Block a user