Skip to content

[codex] add static geometry cache #265

[codex] add static geometry cache

[codex] add static geometry cache #265

Workflow file for this run

name: Main
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out
uses: actions/checkout@v6
- uses: actions/cache@v5
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Set up the environment
uses: ./.github/actions/setup-uv-env
with:
groups: dev
- name: Run checks
run: make check
tests-core:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: ["3.11", "3.13"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up the environment
uses: ./.github/actions/setup-uv-env
with:
python-version: ${{ matrix.python-version }}
groups: dev
- name: Run tests
run: uv run pytest tests -m "not gpu and not network and not ase and not pysis and not train and not hf and not torch_sim and not slow" --cov --cov-config=pyproject.toml --cov-report=xml
- name: Upload coverage reports to Codecov with GitHub Action on Python 3.11
uses: codecov/codecov-action@v6
if: ${{ matrix.python-version == '3.11' }}
with:
flags: core
# Probes torch-core API + CPU-numerics drift across the supported range.
# NOT a dependency-graph test: torch is reinstalled on top of the locked
# warp-lang/nvalchemiops (which do not pin torch), and CI is CPU-only so the
# Warp execution kernels never run. The warp/nvalchemiops coupling is
# validated on GPU (see the GPU validation task).
#
# torch.compile/inductor is DISABLED here (TORCHDYNAMO_DISABLE=1): reinstalling
# torch alone leaves a mismatched triton, so the inductor path cannot be tested
# coherently via reinstall-on-top (it breaks with `triton_key` ImportError on
# torch 2.8). The compile path's cross-version validation belongs in a
# resolver-coherent env, not this eager API/numerics probe.
tests-torch:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
torch-version: ["2.8.*", "2.9.*", "2.10.*", "2.11.*", "2.12.*"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up the environment
uses: ./.github/actions/setup-uv-env
with:
python-version: "3.11"
groups: dev
- name: Override torch (CPU wheel) — desyncs from uv.lock, intentional
env:
TORCH_VERSION: ${{ matrix.torch-version }}
UV_NO_SYNC: "1"
run: |
set -e
uv pip install --python .venv/bin/python --reinstall-package torch \
"torch==${TORCH_VERSION}" \
--index-url https://download.pytorch.org/whl/cpu
uv run --no-sync python -c "import torch; print('torch', torch.__version__)"
- name: Run core tests against torch ${{ matrix.torch-version }}
env:
UV_NO_SYNC: "1"
# Eager only: see job comment — inductor/triton can't be tested via reinstall-on-top.
TORCHDYNAMO_DISABLE: "1"
run: |
uv run --no-sync pytest tests \
-m "not gpu and not network and not ase and not pysis and not train and not hf and not torch_sim and not slow"
tests-ase:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: ["3.11"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v6
- name: Set up the environment
uses: ./.github/actions/setup-uv-env
with:
python-version: ${{ matrix.python-version }}
groups: dev
extras: ase
- name: Run ASE tests
run: uv run pytest tests -m "ase and not sella and not slow" --cov --cov-config=pyproject.toml --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v6
with:
flags: ase
tests-train:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: ["3.11"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v6
- name: Set up the environment
uses: ./.github/actions/setup-uv-env
with:
python-version: ${{ matrix.python-version }}
groups: dev
extras: train
- name: Run train-marked tests (allow empty)
run: |
set -e
uv run pytest tests -m train --cov --cov-config=pyproject.toml --cov-report=xml || rc=$?
if [ "${rc:-0}" -eq 5 ]; then
echo "No train-marked tests collected; treating as success."
exit 0
fi
exit "${rc:-0}"
- name: Upload coverage reports to Codecov
if: hashFiles('coverage.xml') != ''
uses: codecov/codecov-action@v6
with:
flags: train
tests-pysis:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: ["3.11"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v6
- name: Set up the environment
uses: ./.github/actions/setup-uv-env
with:
python-version: ${{ matrix.python-version }}
groups: dev
extras: pysis
- name: Run pysis-marked tests (allow empty)
run: |
set -e
uv run pytest tests -m pysis --cov --cov-config=pyproject.toml --cov-report=xml || rc=$?
if [ "${rc:-0}" -eq 5 ]; then
echo "No pysis-marked tests collected; treating as success."
exit 0
fi
exit "${rc:-0}"
- name: Upload coverage reports to Codecov
if: hashFiles('coverage.xml') != ''
uses: codecov/codecov-action@v6
with:
flags: pysis
tests-sella:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: ["3.11"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v6
- name: Set up the environment
uses: ./.github/actions/setup-uv-env
with:
python-version: ${{ matrix.python-version }}
groups: dev
extras: sella
- name: Run sella-marked tests (allow empty)
run: |
set -e
uv run pytest tests -m sella --cov --cov-config=pyproject.toml --cov-report=xml || rc=$?
if [ "${rc:-0}" -eq 5 ]; then
echo "No sella-marked tests collected; treating as success."
exit 0
fi
exit "${rc:-0}"
- name: Upload coverage reports to Codecov
if: hashFiles('coverage.xml') != ''
uses: codecov/codecov-action@v6
with:
flags: sella
tests-hf:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: ["3.11"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v6
- name: Set up the environment
uses: ./.github/actions/setup-uv-env
with:
python-version: ${{ matrix.python-version }}
groups: dev
extras: hf
- name: Run hf-marked tests (allow empty)
run: |
set -e
uv run pytest tests -m hf --cov --cov-config=pyproject.toml --cov-report=xml || rc=$?
if [ "${rc:-0}" -eq 5 ]; then
echo "No hf-marked tests collected; treating as success."
exit 0
fi
exit "${rc:-0}"
- name: Upload coverage reports to Codecov
if: hashFiles('coverage.xml') != ''
uses: codecov/codecov-action@v6
with:
flags: hf
tests-torchsim:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: ["3.12", "3.13"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v6
- name: Set up the environment
uses: ./.github/actions/setup-uv-env
with:
python-version: ${{ matrix.python-version }}
groups: dev
extras: torchsim,ase
- name: Run torch_sim-marked tests (allow empty)
run: |
set -e
uv run pytest tests -m torch_sim --cov --cov-config=pyproject.toml --cov-report=xml || rc=$?
if [ "${rc:-0}" -eq 5 ]; then
echo "No torch_sim-marked tests collected; treating as success."
exit 0
fi
exit "${rc:-0}"
- name: Upload coverage reports to Codecov
if: hashFiles('coverage.xml') != ''
uses: codecov/codecov-action@v6
with:
flags: torchsim
check-docs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out
uses: actions/checkout@v6
- name: Set up the environment
uses: ./.github/actions/setup-uv-env
with:
groups: docs
- name: Check if documentation can be built
run: uv run mkdocs build -s
deploy-docs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
timeout-minutes: 20
needs:
[
quality,
tests-core,
tests-torch,
tests-ase,
tests-train,
tests-pysis,
tests-sella,
tests-hf,
tests-torchsim,
check-docs,
]
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history and tags for hatch-vcs
- name: Set up the environment
uses: ./.github/actions/setup-uv-env
with:
groups: "dev,docs"
- name: Deploy documentation
run: uv run mkdocs gh-deploy --force