Skip to content

Merge pull request #83 from bigbio/dev #137

Merge pull request #83 from bigbio/dev

Merge pull request #83 from bigbio/dev #137

Workflow file for this run

# Lightweight CI: pre-commit + maturin build (debug) + pytest.
# For release-mode wheel builds across all platforms see wheels.yml.
name: CI
on:
push:
branches: [main, dev]
paths: ["rust/**", ".github/workflows/ci.yml", ".pre-commit-config.yaml"]
pull_request:
branches: [main, dev]
paths: ["rust/**", ".github/workflows/ci.yml", ".pre-commit-config.yaml"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- uses: pre-commit/action@v3.0.1
test:
needs: pre-commit
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.96.0"
components: rustfmt, clippy
- name: Cache Rust build artifacts
uses: actions/cache@v6
with:
path: rust/target
key: ${{ runner.os }}-rust-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: ${{ runner.os }}-rust-
- name: Install system dependencies (cmake for hdf5-metno)
run: sudo apt-get update && sudo apt-get install -y cmake
- name: Build and install wheel (debug)
run: |
pip install maturin pytest
wheel_dir="$(mktemp -d "$RUNNER_TEMP/mokume-wheels.XXXXXX")"
maturin build --out "$wheel_dir"
shopt -s nullglob
wheels=("$wheel_dir"/mokume-*.whl)
if (( ${#wheels[@]} != 1 )); then
printf 'Expected exactly one Mokume wheel, found %d\n' "${#wheels[@]}" >&2
exit 1
fi
pip install "${wheels[0]}[plotting,agentic]" pyarrow
- name: Run the Python test suite
run: pytest tests -v --tb=short
- name: Smoke-test CLI and imports
run: |
python -c "import mokume; print(f'mokume {mokume.__version__}')"
python -c "mokume_ver = __import__('mokume').version(); assert mokume_ver"