Skip to content

Nightly

Nightly #20

Workflow file for this run

name: Nightly
# The expensive gate (full OS × Python matrix, examples, full docs build),
# run once a day — but ONLY if something was committed in the last 24h, so a
# quiet day costs nothing. Manual dispatch always runs. (IMPROVEMENTS.md P-1.)
on:
schedule:
- cron: '0 4 * * *' # 04:00 UTC daily
workflow_dispatch:
concurrency:
group: nightly
cancel-in-progress: false
jobs:
changed:
name: any commit in the last 24h?
runs-on: ubuntu-latest
outputs:
run: ${{ steps.check.outputs.run }}
steps:
- uses: actions/checkout@v4
- id: check
run: |
latest=$(git log -1 --format=%ct)
now=$(date +%s)
age=$(( now - latest ))
if [ "${{ github.event_name }}" = "workflow_dispatch" ] || [ "$age" -lt 86400 ]; then
echo "Last commit ${age}s ago → running nightly."
echo "run=true" >> "$GITHUB_OUTPUT"
else
echo "Last commit ${age}s ago (>24h) → skipping nightly."
echo "run=false" >> "$GITHUB_OUTPUT"
fi
unit-matrix:
name: unit ${{ matrix.os }} · py${{ matrix.python }}
needs: changed
if: needs.changed.outputs.run == 'true'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Install pymoo (compiled) + deps
run: |
pip install --upgrade pip "setuptools>=77" "Cython>=0.29" "numpy>=2.0.0"
pip install -e .
python setup.py build_ext --inplace
pip install -r tests/requirements.txt
pip install "pyclawd>=0.1.1" pytest-xdist
- name: Compiled extensions present
# fail if the Cython extensions didn't compile (P-5b) — no silent slow fallback.
run: python -c "import sys; from pymoo.functions import is_compiled; ok=is_compiled(); print('compiled:', ok); sys.exit(0 if ok else 1)"
- name: Full unit suite (incl. long convergence tests)
run: pytest -n auto -m "not examples and not docs and not golden"
- name: Golden behavior-regression
# res.F baselines are bit-reproducible only on the platform they were
# recorded on (linux-x86_64); population EAs amplify platform libm
# differences into a different front. Run the golden tier on Linux only;
# the test module itself skips on other platforms (tests/test_golden.py).
if: runner.os == 'Linux'
run: pytest -m golden
docs-examples:
name: docs + examples (ubuntu)
needs: changed
if: needs.changed.outputs.run == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- uses: astral-sh/setup-uv@v7
- name: System deps
run: sudo apt-get update && sudo apt-get install -y pandoc xvfb
- name: Install pymoo (compiled) + deps
run: |
pip install --upgrade pip "setuptools>=77" "Cython>=0.29" "numpy>=2.0.0"
pip install -e .
python setup.py build_ext --inplace
pip install -r tests/requirements.txt
pip install "pyclawd>=0.1.1" pytest-xdist pytest-xvfb
- name: Examples (headless via xvfb)
run: pytest -n auto -m examples
- name: Restore docs execution cache
uses: actions/cache@v4
with:
path: docs/.jupyter_cache
key: jupyter-cache-${{ hashFiles('docs/source/**/*.md', 'pymoo/**/*.py') }}
restore-keys: jupyter-cache-
- name: Full docs build (guardrailed; all notebooks execute + HTML renders)
# `pyclawd docs build` runs the output guardrail — fails if an executed
# page rendered blank (the empty-docs failure mode).
run: pyclawd docs build