Skip to content

Fix optimizer checkpoint state round-trip #22

Fix optimizer checkpoint state round-trip

Fix optimizer checkpoint state round-trip #22

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
pyproject.toml
requirements-docs.txt
- name: Install package and test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --retries 5 --timeout 120 -e .[examples] pytest
- name: Run test suite
run: PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest tests
docs:
name: Docs Validation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: pip
cache-dependency-path: requirements-docs.txt
- name: Install documentation dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-docs.txt
- name: Build MkDocs site
run: mkdocs build --strict
- name: Build Sphinx API docs
run: sphinx-build -b html sphinx_docs build/sphinx/html
package:
name: Package Validation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install packaging dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build source and wheel distributions
run: python -m build
- name: Validate distribution metadata
run: twine check dist/*
- name: Smoke test wheel install
run: |
python -m pip install --force-reinstall --no-deps dist/*.whl
python - <<'PY'
import importlib.util
import infty
assert importlib.util.find_spec("infty.optim") is not None
assert importlib.util.find_spec("infty.plot") is not None
assert importlib.util.find_spec("infty.analysis") is None
print("Wheel smoke test passed for", infty.__name__)
PY