Skip to content

fix: include rotor inertia from spanwise blade mass in auto-RNA (#130) #326

fix: include rotor inertia from spanwise blade mass in auto-RNA (#130)

fix: include rotor inertia from spanwise blade mass in auto-RNA (#130) #326

Workflow file for this run

name: CI
on:
push:
branches: [master, main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: pip install -e ".[dev,plots,notebook]"
- name: Test (default — self-contained, no external decks)
run: pytest --tb=short
- name: Test (integration — runs only if local decks happen to be present)
# Integration tests are gated behind the ``integration`` marker
# and skip at module level when their reference data isn't
# available. On GitHub Actions runners no upstream OpenFAST /
# BModes data is checked out, so pytest exits with code 5
# ("no tests collected"); we treat that single exit code as a
# pass so the job stays green when data is absent. Any *other*
# non-zero exit code (e.g. genuine test failure when data IS
# provided via a custom workflow run) still fails the build,
# unlike the old ``continue-on-error: true`` which silently
# swallowed real failures.
#
# ``--no-cov`` disables the coverage gate for this step: the
# integration marker collects only a subset (and nothing at all
# on a runner without the upstream data), whose coverage is far
# below the ``fail_under`` floor. The comprehensive coverage gate
# belongs to the default step above; gating this subset would
# turn the "no data present" case into a spurious exit 1 instead
# of the tolerated exit 5.
run: |
set +e
pytest --tb=short -m integration --no-cov
rc=$?
set -e
if [ "$rc" -eq 0 ] || [ "$rc" -eq 5 ]; then exit 0; fi
echo "integration step failed with exit code $rc"
exit "$rc"
- name: Audit validation matrix
# Asserts every test-file link in VALIDATION.md points at an
# existing file (or directory glob) that defines at least one
# ``def test_…`` method. Catches "claim ahead of test" drift
# at PR time rather than at release time. The script is also
# step 4.5 of docs/release_checklist.rst.
run: python scripts/audit_validation_claims.py
- name: Lint
run: ruff check src/ tests/ scripts/
- name: Type-check
# Type-check at the leg's own Python version so the 3.11 floor is
# still checked (catches 3.12-only APIs) while the 3.12 leg targets
# 3.12 — required for recent numpy's PEP 695 stubs, which mypy
# rejects under a < 3.12 target.
run: mypy src/pybmodes --python-version ${{ matrix.python-version }}
wheel-smoke:
# Build the wheel from source, install it into a fresh venv that
# has nothing else on PYTHONPATH, and exercise the user-facing
# CLI + bundled examples. Catches packaging regressions the
# editable-install test job can't see: missing package_data
# entries, wheel-build failures, sys.path leaks from the
# source tree, and version-mismatch between pyproject.toml and
# what ``importlib.metadata`` reports inside the wheel.
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build deps
run: pip install --upgrade pip build
- name: Build wheel
run: python -m build --wheel
- name: Install wheel into fresh venv
# ``python -m venv`` isolates the wheel from the build deps
# above — anything that wasn't packaged into the wheel won't
# be importable inside the venv.
run: |
python -m venv smoke-venv
./smoke-venv/bin/pip install --upgrade pip
./smoke-venv/bin/pip install dist/pybmodes-*.whl
- name: Version sanity
# The version ``importlib.metadata`` reports must match the
# ``[project] version`` line in pyproject.toml. Running from
# ``/tmp`` rather than the repo root avoids the local
# ``pybmodes.egg-info`` shadowing the wheel's dist-info.
run: |
cd /tmp
expected=$(grep '^version = ' "$GITHUB_WORKSPACE/pyproject.toml" | head -1 | sed -E 's/version = "([^"]+)"/\1/')
actual=$($GITHUB_WORKSPACE/smoke-venv/bin/python -c "import pybmodes; print(pybmodes.__version__)")
echo "expected: $expected"
echo "actual: $actual"
test "$expected" = "$actual"
- name: Vendor bundled examples out of the wheel
# Exercises ``pybmodes examples --copy`` end-to-end and
# confirms the ``_examples/**/*`` package-data glob actually
# ships both ``sample_inputs/`` and ``reference_decks/``.
run: |
cd /tmp
$GITHUB_WORKSPACE/smoke-venv/bin/pybmodes examples --copy ./vendored
test -d ./vendored/sample_inputs
test -d ./vendored/reference_decks
# Spot-check one bundled BMI is present and non-empty.
test -s ./vendored/sample_inputs/01_uniform_blade/uniform_blade.bmi
- name: Sample verifier (4/4 analytical references)
# Runs ``pybmodes._examples.sample_inputs.verify`` against the
# bundled samples. Same suite the release checklist invokes
# manually pre-tag; turning it into a CI step closes the gap
# noted in the post-1.0 review.
run: |
cd /tmp
$GITHUB_WORKSPACE/smoke-venv/bin/python -m pybmodes._examples.sample_inputs.verify
docs:
# Build the Sphinx documentation site with warnings-as-errors.
# Mirrors what Read the Docs runs (.readthedocs.yaml). Surfaces
# broken autodoc references, dead intra-site links, or malformed
# MyST/RST at PR time. The docstring warning backlog was burned
# down in the v1.x infrastructure round; the build is expected to
# be zero-warning from here on.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install with docs extras
run: pip install -e ".[docs,plots,windio]"
- name: Build HTML docs (strict — warnings as errors)
# ``-W`` turns every Sphinx warning into a build failure;
# ``--keep-going`` reports the full set rather than stopping
# at the first one so a single CI run surfaces every issue.
run: sphinx-build -b html docs docs/_build/html -W --keep-going
- name: Upload built docs as artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: html-docs
path: docs/_build/html
retention-days: 7
sdist:
# Build the source distribution and verify it installs from
# source on a clean Python — complements the wheel-smoke job by
# catching MANIFEST.in / package-data issues that only surface
# when pip rebuilds from sdist.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build deps
run: pip install --upgrade pip build
- name: Build sdist
run: python -m build --sdist
- name: Install sdist into fresh venv
run: |
python -m venv sdist-venv
./sdist-venv/bin/pip install --upgrade pip
./sdist-venv/bin/pip install dist/pybmodes-*.tar.gz
- name: Sanity check
run: |
cd /tmp
$GITHUB_WORKSPACE/sdist-venv/bin/python -c "import pybmodes; print(pybmodes.__version__)"