Skip to content

Test/metatensor v0.2.0 #1044

Test/metatensor v0.2.0

Test/metatensor v0.2.0 #1044

Workflow file for this run

name: Documentation
on:
push:
branches: [main]
tags: ["*"]
pull_request:
# Check all PR
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
pull-requests: write
jobs:
build-and-publish:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: setup Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: install dependencies
run: |
python -m pip install tox
sudo apt install doxygen
- name: install metatensor from labels-values-array-clean branch
run: |
pip install setuptools cmake packaging wheel
git clone --depth 1 --branch labels-values-array-clean https://github.com/HaoZeke/metatensor.git ${{ runner.temp }}/metatensor-v020
METATENSOR_NO_LOCAL_DEPS=1 pip install --no-build-isolation ${{ runner.temp }}/metatensor-v020/python/metatensor_core
METATENSOR_NO_LOCAL_DEPS=1 pip install --no-build-isolation ${{ runner.temp }}/metatensor-v020/python/metatensor_operations
METATENSOR_NO_LOCAL_DEPS=1 pip install --no-build-isolation ${{ runner.temp }}/metatensor-v020/python/metatensor_learn
pip install torch
METATENSOR_NO_LOCAL_DEPS=1 pip install --no-build-isolation ${{ runner.temp }}/metatensor-v020/python/metatensor_torch
env:
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu
- name: build documentation
env:
# Use the CPU only version of torch when building/running the code
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu
run: tox -e docs
- name: store documentation as github artifact to be downloaded by users
uses: actions/upload-artifact@v7
with:
name: docs
path: docs/build/html/*
overwrite: true # only keep the latest version of the documentation
- name: Comment with download link
uses: PicoCentauri/comment-artifact@v1
if: github.event.pull_request.head.repo.fork == false
with:
name: docs
description: 📚 Download documentation for this pull-request
- name: put documentation in the website
run: |
git clone https://github.com/metatensor/docs metatensor-docs
rm -rf metatensor-docs/.git
cd metatensor-docs/metatomic
REF_KIND=$(echo $GITHUB_REF | cut -d / -f2)
if [[ "$REF_KIND" == "tags" ]]; then
TAG=${GITHUB_REF#refs/tags/}
mv ../../docs/build/html $TAG
else
rm -rf latest
mv ../../docs/build/html latest
fi
- name: deploy to metatensor-docs
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v4
with:
external_repository: metatensor/docs
deploy_key: ${{ secrets.METATOMIC_DOCS_SSH_KEY }}
publish_branch: main
publish_dir: ./metatensor-docs/
force_orphan: true