Skip to content

docs: align to MVP-first scope (README, API_DESIGN, PROJECT_STRUCTURE… #16

docs: align to MVP-first scope (README, API_DESIGN, PROJECT_STRUCTURE…

docs: align to MVP-first scope (README, API_DESIGN, PROJECT_STRUCTURE… #16

Workflow file for this run

name: Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
schedule:
# Run tests weekly on Monday at 3am UTC
- cron: '0 3 * * 1'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper versioning
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-dev
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install hdf5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# install minimal dev tools explicitly to avoid heavy optional extras
pip install pytest pytest-cov flake8 mypy
pip install -e .
- name: Lint with flake8
run: |
TARGETS="src"
if [ -d tests ]; then TARGETS="$TARGETS tests"; fi
# Stop the build if there are Python syntax errors or undefined names
flake8 $TARGETS --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 $TARGETS --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
- name: Type check with mypy (non-blocking)
continue-on-error: true
run: |
mypy --python-version 3.12 src/mneme --ignore-missing-imports || true
- name: Tests or smoke import
run: |
if [ -d tests ]; then
pytest tests --cov=mneme --cov-report=xml --cov-report=term -v
else
python -c "import mneme; print('mneme import ok')"
fi
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12' && hashFiles('coverage.xml') != '' && env.CODECOV_TOKEN != ''
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false