Skip to content

[fix] More CI debugging. Missing dependencies added. #4

[fix] More CI debugging. Missing dependencies added.

[fix] More CI debugging. Missing dependencies added. #4

Workflow file for this run

name: CI
on:
pull_request:
push:
workflow_dispatch:
permissions:
contents: read
env:
ENV_NAME: aenet-torch
PYTHON_VERSION: "3.11"
TORCH_VERSION: "2.9.0"
PYG_WHEEL_URL: "https://data.pyg.org/whl/torch-2.9.0+cpu.html"
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up micromamba environment
uses: mamba-org/setup-micromamba@v2
with:
environment-name: ${{ env.ENV_NAME }}
create-args: >-
python=${{ env.PYTHON_VERSION }}
pip
cache-environment: true
cache-downloads: true
init-shell: bash
- name: Install project and dependencies
run: |
micromamba run -n "${ENV_NAME}" python -m pip install --upgrade pip
micromamba run -n "${ENV_NAME}" python -m pip install -e ".[dev]"
micromamba run -n "${ENV_NAME}" python -m pip install "torch==${TORCH_VERSION}"
micromamba run -n "${ENV_NAME}" python -m pip install \
torch-scatter torch-cluster -f "${PYG_WHEEL_URL}"
- name: Run general pytest suite
run: |
micromamba run -n "${ENV_NAME}" \
pytest -q -m "not docs_examples" \
--ignore=src/aenet/mlip/tests
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up micromamba environment
uses: mamba-org/setup-micromamba@v2
with:
environment-name: ${{ env.ENV_NAME }}
create-args: >-
python=${{ env.PYTHON_VERSION }}
pip
cache-environment: true
cache-downloads: true
init-shell: bash
- name: Install project and dependencies
run: |
micromamba run -n "${ENV_NAME}" python -m pip install --upgrade pip
micromamba run -n "${ENV_NAME}" python -m pip install -e ".[dev]"
micromamba run -n "${ENV_NAME}" python -m pip install "torch==${TORCH_VERSION}"
micromamba run -n "${ENV_NAME}" python -m pip install \
torch-scatter torch-cluster -f "${PYG_WHEEL_URL}"
- name: Run pytest docs examples
run: |
micromamba run -n "${ENV_NAME}" pytest -q -m docs_examples
- name: Run Sphinx doctest
run: |
micromamba run -n "${ENV_NAME}" \
python -m sphinx -b doctest docs/source docs/build/doctest
- name: Run warning-clean Sphinx HTML build
run: |
micromamba run -n "${ENV_NAME}" \
python -m sphinx -W --keep-going -b html docs/source docs/build/html
notebooks:
name: Notebook (${{ matrix.notebook_name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- notebook: notebooks/example-04-torch-featurization.ipynb
notebook_name: example-04-torch-featurization
- notebook: notebooks/example-05-torch-training.ipynb
notebook_name: example-05-torch-training
- notebook: notebooks/example-07-neighbor-list.ipynb
notebook_name: example-07-neighbor-list
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up micromamba environment
uses: mamba-org/setup-micromamba@v2
with:
environment-name: ${{ env.ENV_NAME }}
create-args: >-
python=${{ env.PYTHON_VERSION }}
pip
cache-environment: true
cache-downloads: true
init-shell: bash
- name: Install project and dependencies
run: |
micromamba run -n "${ENV_NAME}" python -m pip install --upgrade pip
micromamba run -n "${ENV_NAME}" python -m pip install -e ".[dev]"
micromamba run -n "${ENV_NAME}" python -m pip install "torch==${TORCH_VERSION}"
micromamba run -n "${ENV_NAME}" python -m pip install \
torch-scatter torch-cluster -f "${PYG_WHEEL_URL}"
- name: Prepare disposable notebook worktree
run: |
mkdir -p "${RUNNER_TEMP}/notebook-worktree"
rsync -a --delete --exclude ".git" ./ "${RUNNER_TEMP}/notebook-worktree/"
- name: Execute notebook
run: |
mkdir -p "${RUNNER_TEMP}/executed-notebooks"
micromamba run -n "${ENV_NAME}" \
python -m jupyter nbconvert --to notebook --execute \
"${RUNNER_TEMP}/notebook-worktree/${{ matrix.notebook }}" \
--output-dir "${RUNNER_TEMP}/executed-notebooks" \
--ExecutePreprocessor.timeout=600