Skip to content

try docs build

try docs build #440

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
workflow_call:
concurrency:
group: ${{ github.workflow }}-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
test-core:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
version:
- { python: "3.11", resolution: highest }
- { python: "3.12", resolution: lowest-direct }
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version.python }}
- name: Set up uv
uses: astral-sh/setup-uv@v2
- name: Install torchsim
run: uv pip install -e .[test] --resolution=${{ matrix.version.resolution }} --system
- name: Run Tests
run: |
pytest --cov=torch_sim --cov-report=xml \
--ignore=tests/models/test_mace.py \
--ignore=tests/models/test_fairchem.py \
--ignore=tests/models/test_orb.py \
--ignore=tests/models/test_sevennet.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Radical-AI/torch-sim
flags: core,${{ matrix.os }},python-${{ matrix.version.python }}
test-mace:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
version:
- { python: "3.11", resolution: highest }
- { python: "3.12", resolution: lowest-direct }
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version.python }}
- name: Set up uv
uses: astral-sh/setup-uv@v2
- name: Install torchsim
run: uv pip install -e .[test] --resolution=${{ matrix.version.resolution }} --system
- name: Install mace
run: uv pip install mace-torch --system
- name: Run Tests with Coverage
run: pytest --cov=torch_sim --cov-report=xml tests/models/test_mace.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Radical-AI/torch-sim
flags: mace,${{ matrix.os }},python-${{ matrix.version.python }}
test-elastic:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
version:
- { python: "3.11", resolution: highest }
- { python: "3.12", resolution: lowest-direct }
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version.python }}
- name: Set up uv
uses: astral-sh/setup-uv@v2
- name: Install torchsim
run: uv pip install -e .[test] --resolution=${{ matrix.version.resolution }} --system
- name: Install mace
run: uv pip install mace-torch --system
- name: Run Tests with Coverage
run: pytest --cov=torch_sim --cov-report=xml tests/test_elastic.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Radical-AI/torch-sim
flags: elastic,${{ matrix.os }},python-${{ matrix.version.python }}
test-fairchem:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
version:
- { python: "3.11", resolution: highest }
- { python: "3.12", resolution: lowest-direct }
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Check out fairchem
uses: actions/checkout@v4
with:
repository: FAIR-Chem/fairchem
path: fairchem-repo
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version.python }}
- name: Set up uv
uses: astral-sh/setup-uv@v2
- name: Install torchsim
run: uv pip install -e .[test] --resolution=${{ matrix.version.resolution }} --system
- name: Install fairchem dependencies
run: |
if [ -f fairchem-repo/packages/requirements.txt ]; then
uv pip install -r fairchem-repo/packages/requirements.txt --system
fi
if [ -f fairchem-repo/packages/requirements-optional.txt ]; then
uv pip install -r fairchem-repo/packages/requirements-optional.txt --system
fi
uv pip install -e fairchem-repo/packages/fairchem-core[dev] --system
- name: Run Tests with Coverage
run: |
pytest --cov=torchsim --cov-report=xml tests/models/test_fairchem.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Radical-AI/torch-sim
flags: fairchem,${{ matrix.os }},python-${{ matrix.version.python }}
test-orb:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
version:
- { python: "3.11", resolution: highest }
- { python: "3.12", resolution: lowest-direct }
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version.python }}
- name: Set up uv
uses: astral-sh/setup-uv@v2
- name: Install orb dependencies
run: |
uv pip install "orb-models@git+https://github.com/orbital-materials/orb-models#egg=637a98d49cfb494e2491a457d9bbd28311fecf21" --system
- name: Install torchsim
run: uv pip install -e .[test] --resolution=${{ matrix.version.resolution }} --system
- name: Run Tests with Coverage
run: |
pytest --cov=torchsim --cov-report=xml tests/models/test_orb.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Radical-AI/torch-sim
flags: orb,${{ matrix.os }},python-${{ matrix.version.python }}
test-sevennet:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
version:
- { python: "3.11", resolution: highest }
- { python: "3.12", resolution: lowest-direct }
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version.python }}
- name: Set up uv
uses: astral-sh/setup-uv@v2
- name: Install sevennet dependencies
run: |
uv pip install sevenn --system
- name: Install torchsim
run: uv pip install -e .[test] --resolution=${{ matrix.version.resolution }} --system
- name: Run Tests with Coverage
run: |
pytest --cov=torchsim --cov-report=xml tests/models/test_sevennet.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Radical-AI/torch-sim
flags: sevennet,${{ matrix.os }},python-${{ matrix.version.python }}
find-examples:
runs-on: ubuntu-latest
outputs:
examples: ${{ steps.set-matrix.outputs.examples }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Find example scripts
id: set-matrix
run: |
# Find all example scripts but exclude known failing ones
EXAMPLES=$(find examples -name "*.py" | jq -R -s -c 'split("\n")[:-1]')
echo "examples=$EXAMPLES" >> $GITHUB_OUTPUT
test-examples:
needs: find-examples
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: ${{fromJson(needs.find-examples.outputs.examples)}}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Set up uv
uses: astral-sh/setup-uv@v2
- name: Run example
run: uv run --with . ${{ matrix.example }}