Skip to content

fix v2e to use all available cores, fix large uncompressed file strea… #4

fix v2e to use all available cores, fix large uncompressed file strea…

fix v2e to use all available cores, fix large uncompressed file strea… #4

Workflow file for this run

name: Tests
# The publish workflow only runs on a release, by which point a regression has already shipped.
# This runs the suites that already exist — ~240 Rust unit tests and the Python tests under
# `tests/` — on every push and pull request instead.
on:
push:
branches: ["main", "features/**"]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
# A new push supersedes the run in flight for the same branch; wheels take long enough that
# queueing every intermediate commit wastes more time than it catches.
group: tests-${{ github.ref }}
cancel-in-progress: true
jobs:
rust:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
# Default features only: this job is the fast feedback loop, and `hdf5` would compile
# libhdf5 from source on every run. The `python` job below covers the full feature set.
- name: Unit tests
run: cargo test --workspace
- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Formatting
# Advisory for now: fifteen files predate any formatting gate and would fail this on the
# first run. Drop `continue-on-error` once `cargo fmt --all` has been run over the tree —
# that is a mechanical, reviewable commit of its own, not something to bundle into a
# feature change.
continue-on-error: true
run: cargo fmt --all --check
python:
name: pytest (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Linux and macOS differ in linker behaviour for the extension module and in how the
# ONNX Runtime is located at import time, so both are worth running.
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# cmake is what builds the bundled libhdf5; without it the `hdf5` feature cannot compile.
- name: Install cmake (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y cmake
- name: Install ffmpeg
# Only needed by the `.mp4` export tests. They skip cleanly when it is absent, so this
# is here to make sure that path is actually exercised rather than silently skipped.
run: |
if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get install -y ffmpeg; else brew install ffmpeg; fi
shell: bash
- name: Install eventcv and test dependencies
# Builds with the same features as the published wheels, so CI tests what users get.
# The `test` extra carries `onnx` (the writer for the tiny model fixture in
# tests/test_model.py) and `onnxruntime` (the library `Model` opens at run time).
run: |
python -m pip install --upgrade pip
pip install maturin pytest
pip install -e '.[test]'
shell: bash
- name: Run tests
run: pytest tests/ -v
- name: Check the CLI is wired up
run: |
eventcv --version
eventcv info data/test/example.npz
shell: bash
docs:
name: sphinx
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install cmake
run: sudo apt-get update && sudo apt-get install -y cmake
- name: Build the extension and docs toolchain
# autodoc imports the compiled module, so the docs cannot build without it.
run: |
python -m pip install --upgrade pip
pip install maturin
pip install -e .
pip install -r docs/requirements.txt
- name: Build docs
# Not -W: the project carries some pre-existing duplicate-object warnings from the
# curated free-function API. A hard failure would be noise until those are resolved.
run: python -m sphinx -b html docs docs/_build