Skip to content

fix

fix #683

Workflow file for this run

name: tests
on:
push:
permissions:
contents: write
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run ruff
uses: astral-sh/ruff-action@v3
with:
src: "./src"
version-file: "uv.lock"
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- 3.9
- "3.10"
- 3.11
name: test - ${{ matrix.python-version }}
steps:
### SETUP ###
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install graph-pes and required dependencies
run: uv sync --extra test
- name: Useful info
run: uv pip freeze
### CODE TESTS ###
- name: Run tests
run: PYTHONPATH=. uv run pytest --cov --cov-report xml tests/
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
# only upload coverage reports for the first python version
if: matrix.python-version == '3.9'
with:
token: ${{secrets.CODECOV_TOKEN}}
- name: Run a very small training run
run: |
uv run graph-pes-train configs/minimal.yaml \
data/+load_atoms_dataset/n_train=10 \
data/+load_atoms_dataset/n_valid=10 \
fitting/trainer_kwargs/max_epochs=5 \
wandb=null \
general/root_dir=results \
general/run_id=test-run
- name: Run a very small testing run
run: |
uv run graph-pes-test model_path=results/test-run/model.pt \
data/+file_dataset/path=tests/helpers/test.xyz \
data/+file_dataset/cutoff=5.0
docs:
runs-on: ubuntu-latest
steps:
### SETUP ###
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install pandoc
run: sudo apt-get install -y --no-install-recommends pandoc
- name: Install graph-pes and required dependencies
run: uv sync --extra docs
### DOCS ###
- name: Build docs
# -n: nitpick:
# -W: turn warnings into errors
run: uv run sphinx-build -nW docs/source docs/build --keep-going
- name: Publich docs
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/
force_orphan: true
mace-torch-interface:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install graph-pes and required dependencies
run: uv sync --extra test
- name: Install mace-torch
run: uv pip install mace-torch torch==2.5 # TODO: unfix this version
- name: Run tests
run: uv run pytest src/graph_pes/interfaces/mace_test.py -vvv
mattersim-interface:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install graph-pes and required dependencies
run: uv sync --extra test
- name: Install mattersim
run: uv pip install mattersim==1.0.0
- name: Run tests
run: uv run pytest src/graph_pes/interfaces/mattersim_test.py -vvv