Skip to content

Merge pull request #46 from neuromechanist/45-add-ci-ruff-typos-build… #3

Merge pull request #46 from neuromechanist/45-add-ci-ruff-typos-build…

Merge pull request #46 from neuromechanist/45-add-ci-ruff-typos-build… #3

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint (ruff)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
enable-cache: true
- run: uv sync
- name: ruff check
run: uv run ruff check .
- name: ruff format --check
run: uv run ruff format --check .
typos:
name: Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@v1
test:
name: Test (Python 3.12)
needs: lint
runs-on: ubuntu-latest
env:
PYTORCH_ENABLE_MPS_FALLBACK: "1"
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
enable-cache: true
- run: uv sync
# Exclude the "slow" parity tests: they invoke the macOS-only Fortran
# reference binary (pyAMICA/sample_data/amica15mac), which cannot run on
# the Linux runner. MPS-specific tests self-skip when MPS is absent.
- name: pytest (excluding slow / Fortran-binary parity tests)
run: uv run pytest -m "not slow"
build:
name: Build + import (Python ${{ matrix.python-version }})
needs: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Build sdist + wheel
run: uv build
# Verify requires-python>=3.12 compatibility: install the built wheel and
# its declared dependencies into a clean environment and import it.
- name: Install wheel into a clean env and import
run: |
uv venv --python ${{ matrix.python-version }} .import-venv
uv pip install --python .import-venv dist/*.whl
.import-venv/bin/python -c "import pyAMICA; print('pyAMICA', pyAMICA.__version__)"