Skip to content

Delete assets/02c_partial_collapse_month9_labeled_en.png #203

Delete assets/02c_partial_collapse_month9_labeled_en.png

Delete assets/02c_partial_collapse_month9_labeled_en.png #203

Workflow file for this run

name: tests
on:
push:
pull_request:
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install package and test dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest
- name: Run test suite
run: pytest -q
imports:
# Build and install the real distribution, then leave the checkout before
# importing. An editable install can hide packages omitted from the wheel.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- run: |
python -m pip install --upgrade pip
pip install build
python -m build --wheel
pip install dist/*.whl
- name: Import every packaged entry point
run: |
cd "$(mktemp -d)"
python -c "import lung_nematic"
python -c "import lung_nematic.synthetic"
python -c "import simulations.alveolar"
python -c "import simulations.alveolar3d"
python -c "import simulations.fibrofocus"
python -c "import simulations.coupled_analysis"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- run: pip install ruff==0.16.0
- name: Ruff
run: ruff check lung_nematic simulations tests
notebooks:
# A malformed notebook (collapsed source, invalid schema) is invisible until
# someone opens it in Colab. nbformat.validate catches it in CI.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- run: pip install nbformat
- name: Validate notebooks
run: |
python - <<'PY'
import glob, sys
import nbformat
failed = False
for path in glob.glob("*.ipynb"):
try:
nbformat.validate(nbformat.read(path, as_version=4))
print(f"ok {path}")
except Exception as error:
print(f"FAIL {path}: {error}")
failed = True
sys.exit(1 if failed else 0)
PY