Skip to content

Test suite + set_spike_extraction #131

Test suite + set_spike_extraction

Test suite + set_spike_extraction #131

Workflow file for this run

name: Tests
on:
push:
branches:
- 'master'
- 'releases/**'
pull_request:
branches:
- master
defaults:
run:
shell: bash
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/ruff-action@v3
with:
args: check
src: pycbsdk/src
- uses: astral-sh/ruff-action@v3
with:
args: format --check
src: pycbsdk/src
test:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {name: "windows-x64", os: "windows-latest", cmake_extra: "-T v142,host=x86"}
- {name: "macOS-latest", os: "macOS-latest"}
- {name: "ubuntu-latest", os: "ubuntu-latest"}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # setuptools-scm needs tags
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v6
# Single build: tests + shared library
- name: Configure
run: |
cmake -B build -S . \
-DCBSDK_BUILD_CBMEX=OFF \
-DCBSDK_BUILD_CBOCT=OFF \
-DCBSDK_BUILD_TEST=ON \
-DCBSDK_BUILD_SAMPLE=OFF \
-DCBSDK_BUILD_SHARED=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \
${{ matrix.config.cmake_extra }}
- name: Build
run: cmake --build build --config Release -j
# C++ unit tests (fast, no device needed)
- name: Unit Tests
run: >
ctest --test-dir build --build-config Release --output-on-failure
-E "^(device|integration)\."
# C++ integration tests (nPlayServer downloaded at configure time)
- name: Integration Tests
run: >
ctest --test-dir build --build-config Release --output-on-failure
-R "^integration\."
timeout-minutes: 10
# pycbsdk tests (reuse the shared library from the same build)
- name: Install shared library
run: cmake --install build --config Release
- name: Set library path
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
echo "CBSDK_LIB_DIR=${{ github.workspace }}/install/bin" >> "$GITHUB_ENV"
else
echo "CBSDK_LIB_DIR=${{ github.workspace }}/install/lib" >> "$GITHUB_ENV"
fi
- name: Install pycbsdk
working-directory: pycbsdk
run: uv sync
- name: pycbsdk Tests
working-directory: pycbsdk
run: uv run pytest tests/ -m integration --timeout=120 -v
timeout-minutes: 10